[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] svn r849 fails to compile with gcc 6.2 -O3
From: |
Xiao-Yong Jin |
Subject: |
Re: [Bug-apl] svn r849 fails to compile with gcc 6.2 -O3 |
Date: |
Wed, 18 Jan 2017 09:57:47 -0600 |
Yes, it remains an error.
The number 255 as I understand comes from
src/SymbolTable.hh:235:class SystemSymTab : public SymbolTableBase<SystemName,
256 - 1>
> On Jan 18, 2017, at 9:41 AM, Juergen Sauermann <address@hidden> wrote:
>
> Hi Xiao-Yong,
>
> I have simplified the loop a little hoping that gcc will get less confused.
> *SVN 854*.
>
> If the warning remains then it is definitely bogus.
>
> Also, I can't really see why iteration 255 should behave differently than all
> the others.
>
> /// Jürgen
>
>
> On 01/17/2017 05:10 AM, Xiao-Yong Jin wrote:
>> In addition, there is one more warning/error.
>>
>> g++ -DHAVE_CONFIG_H -I. -I.. -Werror -Wall -I sql
>> -I/sandbox/pkg/lib/include -I/sandbox/pkg/include -rdynamic
>> -Wno-maybe-uninitialized -march=native -O3 -pipe -I/sandbox/pkg/include -MT
>> apl-SymbolTable.o -MD -MP -MF .deps/apl-SymbolTable.Tpo -c -o
>> apl-SymbolTable.o `test -f 'SymbolTable.cc' || echo './'`SymbolTable.cc
>> SymbolTable.cc: In member function ‘void SystemSymTab::clear(std::ostream&)’:
>> SymbolTable.cc:499:37: error: iteration 255 invokes undefined behavior
>> [-Werror=aggressive-loop-optimizations]
>> SystemName * sym = symbol_table[hash];
>> ^
>> In file included from Assert.hh:24:0,
>> from Simple_string.hh:33,
>> from CDR_string.hh:24,
>> from CDR.hh:24,
>> from SymbolTable.cc:24:
>> Common.hh:106:44: note: within this loop
>> #define loop(v, e) for (ShapeItem v = 0; v < ShapeItem(e); ++v)
>>
>> SymbolTable.cc:493:4: note: in expansion of macro ‘loop’
>> loop(hash, SYMBOL_HASH_TABLE_SIZE) clear_slot(out, hash);
>> ^~~~
>> cc1plus: all warnings being treated as errors
>>
>>> On Jan 16, 2017, at 8:05 PM, Xiao-Yong Jin <address@hidden> wrote:
>>>
>>> Not sure if it's another gcc unrolling bug.
>>> Using gcc 6.2.0
>>>
>>> g++ -DHAVE_CONFIG_H -I. -I.. -Werror -Wall -I sql
>>> -I/sandbox/pkg/lib/include -I/sandbox/pkg/include -rdynamic -march=native
>>> -O3 -pipe -I/sandbox/pkg/include -MT apl-Bif_F12_SORT.o -MD -MP -MF .deps/ap
>>> l-Bif_F12_SORT.Tpo -c -o apl-Bif_F12_SORT.o `test -f 'Bif_F12_SORT.cc' ||
>>> echo './'`Bif_F12_SORT.cc
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh: In constructor ‘CollatingCache::CollatingCache(const Value&,
>>> const Cell*, ShapeItem)’:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[7]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[7]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[6]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[6]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[5]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[5]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[4]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[4]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[3]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[3]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[2]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[2]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> In file included from PrintBuffer.hh:28:0,
>>> from Cell.hh:27,
>>> from Value.hh:30,
>>> from Value.icc:24,
>>> from NamedObject.hh:25,
>>> from Function.hh:27,
>>> from PrimitiveFunction.hh:25,
>>> from Bif_F12_SORT.hh:25,
>>> from Bif_F12_SORT.cc:22:
>>> Shape.hh:143:43: error: ‘*((void*)(& entry)+8).Shape::rho[1]’ may be used
>>> uninitialized in this function [-Werror=maybe-uninitialized]
>>> rho[rho_rho++] = len; volume *= len; }
>>> ^~~
>>> Bif_F12_SORT.cc:56:36: note: ‘*((void*)(& entry)+8).Shape::rho[1]’ was
>>> declared here
>>> const CollatingCacheEntry entry(uni, A.get_shape());
>>> ^~~~~
>>> cc1plus: all warnings being treated as errors
>>> make[3]: *** [apl-Bif_F12_SORT.o] Error 1
>>
>>
>