This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/48968] incorrect warning about longjmp/vfork clobbering a local (-W -O2, x86-64)


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

--- Comment #7 from eggert at gnu dot org 2012-06-01 21:19:16 UTC ---
Created attachment 27546
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27546
alternate test case, for x86, showing "({anonymous}) might be clobbered"

By compiling on x86 (as opposed to x86-64) and tweaking the source code a bit I
got a different diagnostic "error: variable '({anonymous})' might be clobbered
by 'longjmp' or 'vfork'" which may help indicate where the problem is. 
Uncompress and compile the attached program with:

gcc -v -m32 -std=gnu99 -c -Werror=clobbered -g -O2 t.i

and the output is:

Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.0/configure
--prefix=/home/eggert/opt/Linux-x86_64/gcc-4.7.0 --disable-nls
Thread model: posix
gcc version 4.7.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-m32' '-std=gnu99' '-c' '-Werror=clobbered' '-g'
'-O2' '-mtune=generic' '-march=x86-64'

/home/eggert/opt/Linux-x86_64/gcc-4.7.0/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1
-fpreprocessed t.i -quiet -dumpbase t.i -m32 -mtune=generic -march=x86-64
-auxbase t -g -O2 -Werror=clobbered -std=gnu99 -version -o /tmp/cc9OhgtR.s
GNU C (GCC) version 4.7.0 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.0, GMP version 4.3.2, MPFR version 3.0.0, MPC
version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (GCC) version 4.7.0 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.0, GMP version 4.3.2, MPFR version 3.0.0, MPC
version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0b542ccc033bf565e8473ef2771f60ec
t.i: In function 'read_char':
t.i:14930:1: error: variable '({anonymous})' might be clobbered by 'longjmp' or
'vfork' [-Werror=clobbered]
t.i:14930:1: error: variable '({anonymous})' might be clobbered by 'longjmp' or
'vfork' [-Werror=clobbered]
t.i:14930:1: error: variable '({anonymous})' might be clobbered by 'longjmp' or
'vfork' [-Werror=clobbered]
t.i:14930:1: error: variable '({anonymous})' might be clobbered by 'longjmp' or
'vfork' [-Werror=clobbered]
cc1: some warnings being treated as errors


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]