public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
@ 2013-07-05 18:59 olivier.pis.langlois at transport dot alstom.com
  2021-03-26 22:16 ` [Bug middle-end/57832] " msebor at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: olivier.pis.langlois at transport dot alstom.com @ 2013-07-05 18:59 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 11355 bytes --]

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

            Bug ID: 57832
           Summary: compiling sha-256 code (xz 5.0.5) generates false
                    warnings when using -march=native on Atom CPU
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olivier.pis.langlois at transport dot alstom.com

Created attachment 30465
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30465&action=edit
intermediate file

When I compile check/sha256.c (from xz 5.0.5) without '-march=native' (should
be atom), compiler process the input file.

With '-march=native', it generates, IMO, false warnings.

lano1106@hpmini ~/dev/packages/xz/repos/core-i686/src/xz-5.0.5/src/liblzma $
gcc -v -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I../../src/liblzma/api
-I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz
-I../../src/liblzma/rangecoder -I../../src/liblzma/lzma
-I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common
-DTUKLIB_SYMBOL_PREFIX=lzma_ -D_FORTIFY_SOURCE=2 -pthread -fvisibility=hidden
-Wall -Wextra -Wvla -Wformat=2 -Winit-self -Wmissing-include-dirs
-Wstrict-aliasing -Wfloat-equal -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wwrite-strings -Wlogical-op -Waggregate-return
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes
-Wmissing-declarations -Wmissing-noreturn -Wredundant-decls -Werror
-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -MT
liblzma_la-sha256.lo -MD -MP -MF .deps/liblzma_la-sha256.Tpo -c check/sha256.c 
-fPIC -DPIC -o .libs/liblzma_la-sha256.o
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
Target: i686-pc-linux-gnu
Configured with: /build/gcc/src/gcc-4.8.1/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-install-libiberty --disable-multilib --disable-libssp
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=gnu99' '-D' 'HAVE_CONFIG_H' '-I' '.' '-I'
'../..' '-I' '../../src/liblzma/api' '-I' '../../src/liblzma/common' '-I'
'../../src/liblzma/check' '-I' '../../src/liblzma/lz' '-I'
'../../src/liblzma/rangecoder' '-I' '../../src/liblzma/lzma' '-I'
'../../src/liblzma/delta' '-I' '../../src/liblzma/simple' '-I'
'../../src/common' '-D' 'TUKLIB_SYMBOL_PREFIX=lzma_' '-D' '_FORTIFY_SOURCE=2'
'-pthread' '-fvisibility=hidden' '-Wall' '-Wextra' '-Wvla' '-Wformat=2'
'-Winit-self' '-Wmissing-include-dirs' '-Wstrict-aliasing' '-Wfloat-equal'
'-Wundef' '-Wshadow' '-Wpointer-arith' '-Wbad-function-cast' '-Wwrite-strings'
'-Wlogical-op' '-Waggregate-return' '-Wstrict-prototypes'
'-Wold-style-definition' '-Wmissing-prototypes' '-Wmissing-declarations'
'-Wsuggest-attribute=noreturn' '-Wredundant-decls' '-Werror' '-march=native'
'-O2' '-pipe' '-fstack-protector' '--param' 'ssp-buffer-size=4' '-MT'
'liblzma_la-sha256.lo' '-MD' '-MP' '-MF' '.deps/liblzma_la-sha256.Tpo' '-c'
'-fPIC' '-D' 'PIC' '-o' '.libs/liblzma_la-sha256.o'
 /usr/lib/gcc/i686-pc-linux-gnu/4.8.1/cc1 -quiet -v -I . -I ../.. -I
../../src/liblzma/api -I ../../src/liblzma/common -I ../../src/liblzma/check -I
../../src/liblzma/lz -I ../../src/liblzma/rangecoder -I ../../src/liblzma/lzma
-I ../../src/liblzma/delta -I ../../src/liblzma/simple -I ../../src/common -MD
.libs/liblzma_la-sha256.d -MF .deps/liblzma_la-sha256.Tpo -MP -MT
liblzma_la-sha256.lo -D_REENTRANT -D HAVE_CONFIG_H -D
TUKLIB_SYMBOL_PREFIX=lzma_ -D _FORTIFY_SOURCE=2 -D PIC check/sha256.c
-march=atom -mcx16 -msahf -mmovbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm
-mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx
-mno-avx2 -mno-sse4.2 -mno-sse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd
-mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave
-mno-xsaveopt --param l1-cache-size=0 --param l1-cache-line-size=0 --param
l2-cache-size=512 -mtune=atom -quiet -dumpbase sha256.c -auxbase-strip
.libs/liblzma_la-sha256.o -O2 -Wall -Wextra -Wvla -Wformat=2 -Winit-self
-Wmissing-include-dirs -Wstrict-aliasing -Wfloat-equal -Wundef -Wshadow
-Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wlogical-op
-Waggregate-return -Wstrict-prototypes -Wold-style-definition
-Wmissing-prototypes -Wmissing-declarations -Wsuggest-attribute=noreturn
-Wredundant-decls -Werror -std=gnu99 -version -fvisibility=hidden
-fstack-protector -fPIC --param ssp-buffer-size=4 -o - |
 as -v -I . -I ../.. -I ../../src/liblzma/api -I ../../src/liblzma/common -I
../../src/liblzma/check -I ../../src/liblzma/lz -I ../../src/liblzma/rangecoder
-I ../../src/liblzma/lzma -I ../../src/liblzma/delta -I
../../src/liblzma/simple -I ../../src/common --32 -o .libs/liblzma_la-sha256.o
GNU assembler version 2.23.2 (i686-pc-linux-gnu) using BFD version (GNU
Binutils) 2.23.2
GNU C (GCC) version 4.8.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-linux-gnu/4.8.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 ../..
 ../../src/liblzma/api
 ../../src/liblzma/common
 ../../src/liblzma/check
 ../../src/liblzma/lz
 ../../src/liblzma/rangecoder
 ../../src/liblzma/lzma
 ../../src/liblzma/delta
 ../../src/liblzma/simple
 ../../src/common
 /usr/lib/gcc/i686-pc-linux-gnu/4.8.1/include
 /usr/local/include
 /usr/lib/gcc/i686-pc-linux-gnu/4.8.1/include-fixed
 /usr/include
End of search list.
GNU C (GCC) version 4.8.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2963cf20dad9f99b27bcc12dcdc7b43f
check/sha256.c: In function âprocessâ:
check/sha256.c:85:11: error: âW[6]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  uint32_t W[16];
           ^
check/sha256.c:85:11: error: âW[5]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[13]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[4]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[12]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[3]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[11]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[2]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[10]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[15]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[0]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[1]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[9]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
check/sha256.c:85:11: error: âW[14]â may be used uninitialized in this function
[-Werror=maybe-uninitialized]
cc1: all warnings being treated as errors
lano1106@hpmini ~/dev/packages/xz/repos/core-i686/src/xz-5.0.5/src/liblzma :( $
cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 28
model name      : Intel(R) Atom(TM) CPU N455   @ 1.66GHz
>From gcc-bugs-return-425830-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 05 19:02:43 2013
Return-Path: <gcc-bugs-return-425830-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4247 invoked by alias); 5 Jul 2013 19:02:43 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 4208 invoked by uid 48); 5 Jul 2013 19:02:37 -0000
From: "olivier.pis.langlois at transport dot alstom.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
Date: Fri, 05 Jul 2013 19:02:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olivier.pis.langlois at transport dot alstom.com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-57832-4-2qBm4Bh1Bi@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57832-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57832-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg00337.txt.bz2
Content-length: 892

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW832

--- Comment #1 from Olivier Langlois <olivier.pis.langlois at transport dot alstom.com> ---
Created attachment 30466
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0466&actioníit
original c file

very macro heavy loop unrolling sha-256 code hand optimized code (I have peaked
into the resulting intermediate code, yuck!) but the code seems ok:

#define blk0(i) (W[i] = data[i])
#define blk2(i) (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] \
+ s0(W[(i - 15) & 15]))
...
#define R(i) \
h(i) += S1(e(i)) + Ch(e(i), f(i), g(i)) + SHA256_K[i + j] \
+ (j ? blk2(i) : blk0(i)); \
...
// 64 operations, partially loop unrolled
for (unsigned int j = 0; j < 64; j += 16) {
R( 0); R( 1); R( 2); R( 3);
R( 4); R( 5); R( 6); R( 7);
R( 8); R( 9); R(10); R(11);
R(12); R(13); R(14); R(15);
}

so for j = 0, all W items will be initialized.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
@ 2021-03-26 22:16 ` msebor at gcc dot gnu.org
  2021-03-27  9:02 ` manu at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-26 22:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2018-10-09 00:00:00         |2021-3-26
      Known to fail|                            |10.2.0, 11.0, 4.8.4, 4.9.4,
                   |                            |5.5.0, 6.4.0, 7.2.0, 8.3.0,
                   |                            |9.1.0
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Reconfirmed with GCC 11 and a slightly further reduced test case:

int a, b, d;

void f (void)
{
  unsigned c;

  for (int e = 0; e < 64; e += 6)
    {
      if (e)
        b = e;
      else
        c = d;

      if (e)
        a += c;
    }
}

The output with a slightly patched GCC to add notes after the warning shows the
condition under which the variable is used uninitialized:

pr57832.c: In function ‘f’:
pr57832.c:15:11: warning: ‘c’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   15 |         a += c;
      |           ^~
pr57832.c:5:12: note: used when ‘ivtmp != 0’
    5 |   unsigned c;
      |            ^
pr57832.c:5:12: note: ‘c’ was declared here


The annotated dump below helps explain what's going on: the c_21 PHI in bb 3 is
(partly) uninitialized.  The warning finds its first use (1) in c_21 in bb 3. 
It then finds its use (2) in c_25 in bb 5.  Finally, it finds c_25's use (3) in
the assignment to _4 in bb 4.  In other words, the uninitialized c flows from
<bb 2: c_12(D)> -> <bb 3: c_21> -> <bb 8> -> <bb 5: c25> -> <bb 3: c_21> -> <bb
4: _4>.  I don't see anything in the IL to avoid coming to this conclusion so I
don't think there's anything to change in the warning code to suppress it.


;; Function f (f, funcdef_no=0, decl_uid=1946, cgraph_uid=1, symbol_order=3)

[WORKLIST]: add to initial list: c_21 = PHI <c_25(5), c_12(D)(2)>
[CHECK]: examining phi: c_21 = PHI <c_25(5), c_12(D)(2)>

[CHECK] Found def edge 1 in c_25 = PHI <c_21(8), c_14(7)>
[CHECK]: Found unguarded use: c_25 = PHI <c_21(8), c_14(7)>
[WORKLIST]: Update worklist with phi: c_25 = PHI <c_21(8), c_14(7)>

[CHECK] Found def edge 1 in c_25 = PHI <c_21(8), c_14(7)>
[CHECK]: Found unguarded use: _4 = a.2_3 + c_21;

{
  unsigned int ivtmp.11;
  unsigned int ivtmp.10;
  int a_lsm.7;
  int b_lsm.6;
  int e;
  unsigned int c;
  int d.0_1;
  unsigned int a.2_3;
  unsigned int _4;
  int _5;

  <bb 2> [local count: 89442694]:
  d.0_1 = d;
  c_14 = (unsigned int) d.0_1;
  a_lsm.7_18 = a;

  <bb 3> [local count: 984299128]:
  # c_21 = PHI <c_25(5), c_12(D)(2)>                   <<< use 1: c_12(D) is
uninitialized
  # a_lsm.7_11 = PHI <a_lsm.7_10(5), a_lsm.7_18(2)>
  # ivtmp.10_2 = PHI <ivtmp.10_7(5), 0(2)>
  # ivtmp.11_20 = PHI <ivtmp.11_26(5), 6(2)>
  e_22 = (int) ivtmp.10_2;
  if (e_22 != 0)
    goto <bb 4>; [64.00%]
  else
    goto <bb 7>; [36.00%]

  <bb 7> [local count: 354347685]:
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 629951444]:
  a.2_3 = (unsigned int) a_lsm.7_11;
  _4 = a.2_3 + c_21;                                   <<< use 3:
-Wmaybe-uninitialized
  _5 = (int) _4;
  e_17 = (int) ivtmp.11_20;
  if (e_17 <= 63)
    goto <bb 8>; [86.98%]
  else
    goto <bb 6>; [13.02%]

  <bb 8> [local count: 547959327]:                     <<< c_21(8) = c21(3)

  <bb 5> [local count: 902307011]:
  # c_25 = PHI <c_21(8), c_14(7)>                      <<< use 2: c_25 =
c_21(8)
  # a_lsm.7_10 = PHI <_5(8), a_lsm.7_11(7)>
  ivtmp.10_7 = ivtmp.10_2 + 6;
  ivtmp.11_26 = ivtmp.11_20 + 6;
  goto <bb 3>; [100.00%]

  <bb 6> [local count: 89442696]:
  b = e_22;
  a = _5;
  return;

}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
  2021-03-26 22:16 ` [Bug middle-end/57832] " msebor at gcc dot gnu.org
@ 2021-03-27  9:02 ` manu at gcc dot gnu.org
  2021-03-27 21:32 ` msebor at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2021-03-27  9:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Either there is no bug or the reduction is incorrect because the warning in the
testcase is correct since d is uninitialized. Maybe the bug is that it warns
about 'c' and not about 'd', but probably at the time of warning 'd' is long
gone.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
  2021-03-26 22:16 ` [Bug middle-end/57832] " msebor at gcc dot gnu.org
  2021-03-27  9:02 ` manu at gcc dot gnu.org
@ 2021-03-27 21:32 ` msebor at gcc dot gnu.org
  2021-03-28 11:17 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-27 21:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
In the reduced test cases (in comment #3 and comment #4) d is a global variable
so it's value is zero.  c is assigned in the first iteration of the loop (when
e is zero) and used in subsequent iterations when it has a defined value, so
the warning .seems like a clear false postive to me.  (I didn't look at the big
test case.)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
                   ` (2 preceding siblings ...)
  2021-03-27 21:32 ` msebor at gcc dot gnu.org
@ 2021-03-28 11:17 ` manu at gcc dot gnu.org
  2022-11-20  3:50 ` law at gcc dot gnu.org
  2022-11-20  4:13 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu.org @ 2021-03-28 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #6)
> In the reduced test cases (in comment #3 and comment #4) d is a global
> variable so it's value is zero.  c is assigned in the first iteration of the
> loop (when e is zero) and used in subsequent iterations when it has a
> defined value, so the warning .seems like a clear false postive to me.  (I
> didn't look at the big test case.)

Oh, yes! Sorry, my comment didn't make sense. Even simpler:

int a, d;

void f (void)
{
  int c;
  for (int e = 0; e < 64; e += 6)
    {
      if (e == 0)
            c = d;
      else 
            a += c;
    }
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
                   ` (3 preceding siblings ...)
  2021-03-28 11:17 ` manu at gcc dot gnu.org
@ 2022-11-20  3:50 ` law at gcc dot gnu.org
  2022-11-20  4:13 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2022-11-20  3:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |13.0
         Resolution|---                         |FIXED
                 CC|                            |law at gcc dot gnu.org

--- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Seems to have been fixed on the trunk, most likely Richi's work from earlier
this year.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/57832] compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU
  2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
                   ` (4 preceding siblings ...)
  2022-11-20  3:50 ` law at gcc dot gnu.org
@ 2022-11-20  4:13 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-20  4:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57832

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-20  4:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 18:59 [Bug c/57832] New: compiling sha-256 code (xz 5.0.5) generates false warnings when using -march=native on Atom CPU olivier.pis.langlois at transport dot alstom.com
2021-03-26 22:16 ` [Bug middle-end/57832] " msebor at gcc dot gnu.org
2021-03-27  9:02 ` manu at gcc dot gnu.org
2021-03-27 21:32 ` msebor at gcc dot gnu.org
2021-03-28 11:17 ` manu at gcc dot gnu.org
2022-11-20  3:50 ` law at gcc dot gnu.org
2022-11-20  4:13 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).