Bug 32815 - crtstuff.c,warning, will always evaluate as 'true'
Summary: crtstuff.c,warning, will always evaluate as 'true'
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.2.1
: P5 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, diagnostic
Depends on:
Blocks:
 
Reported: 2007-07-19 02:59 UTC by littlestar
Modified: 2018-08-07 11:41 UTC (History)
2 users (show)

See Also:
Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
Build: hppa64-hp-hpux11.11
Known to work: 3.4.6
Known to fail: 4.2.1
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description littlestar 2007-07-19 02:59:57 UTC
../../src/gcc/crtstuff.c: In function '__do_global_dtors_aux':
../../src/gcc/crtstuff.c:298: warning: the address of '__deregister_frame_info' will always evaluate as 'true'
../../src/gcc/crtstuff.c: In function 'frame_dummy':
../../src/gcc/crtstuff.c:332: warning: the address of '__register_frame_info' will always evaluate as 'true'
/home/beans/gcc-build/build/./gcc/xgcc -B/home/beans/gcc-build/build/./gcc/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/bin/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/lib/ -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/include -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/sys-include -O2 -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
          -c ../../src/gcc/crtstuff.c -DCRT_END \
          -o crtend.o
/home/beans/gcc-build/build/./gcc/xgcc -B/home/beans/gcc-build/build/./gcc/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/bin/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/lib/ -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/include -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/sys-include -O2 -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
          -c ../../src/gcc/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
          -o crtbeginS.o
../../src/gcc/crtstuff.c: In function '__do_global_dtors_aux':
../../src/gcc/crtstuff.c:276: warning: the address of '__cxa_finalize' will always evaluate as 'true'
../../src/gcc/crtstuff.c:298: warning: the address of '__deregister_frame_info' will always evaluate as 'true'
../../src/gcc/crtstuff.c: In function 'frame_dummy':
../../src/gcc/crtstuff.c:332: warning: the address of '__register_frame_info' will always evaluate as 'true'
/home/beans/gcc-build/build/./gcc/xgcc -B/home/beans/gcc-build/build/./gcc/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/bin/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/lib/ -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/include -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/sys-include -O2 -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
          -c ../../src/gcc/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
          -o crtendS.o
/home/beans/gcc-build/build/./gcc/xgcc -B/home/beans/gcc-build/build/./gcc/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/bin/ -B/opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/lib/ -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/include -isystem /opt/gcc-4.1.2/lp64/hppa64-hp-hpux11.11/sys-include -O2 -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/../include -I../../src/gcc/../libcpp/include  -I../../src/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
          -c ../../src/gcc/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
          -o crtbeginT.o
../../src/gcc/crtstuff.c: In function '__do_global_dtors_aux':
../../src/gcc/crtstuff.c:298: warning: the address of '__deregister_frame_info' will always evaluate as 'true'
../../src/gcc/crtstuff.c: In function 'frame_dummy':
../../src/gcc/crtstuff.c:332: warning: the address of '__register_frame_info' will always evaluate as 'true'
Comment 1 littlestar 2007-07-19 03:01:32 UTC
boot gcc, 3.4.6
Comment 2 littlestar 2007-07-19 03:12:14 UTC
I think $(GCC)/Makefile.in must remove -O2 for build.
Because the boot GCC may have some bugs with -O2.
It's known that -O2 contain "-fstrict-aliasing" which has bugs since gcc 3.X.
Comment 3 Andrew Pinski 2007-07-19 06:59:12 UTC
> It's known that -O2 contain "-fstrict-aliasing" which has bugs since gcc 3.X.
Huh?????
Comment 4 littlestar 2007-07-19 07:03:29 UTC
When I build gcc-4.2.1(prelease) on HPUX11.11, there is some warning..

why the share library build by GCC4.X on HPUX11.11 can't work..
some symbol required by the shared library could not be found.

But these works on by GCC3.4.6 or native hpcc.
Comment 5 littlestar 2007-07-19 07:05:40 UTC
(In reply to comment #3)
> > It's known that -O2 contain "-fstrict-aliasing" which has bugs since gcc 3.X.
> Huh?????

from 4.2.1 status report.
PR 32182 -fstrict-aliasing ...
PR 32327 Incorrect stack sharing...
PR 32328 -fstrict-aliasing ...

...


Comment 6 John David Anglin 2007-10-29 01:41:42 UTC
The warnings are expected.  From pa64-hpux.h:

/* We don't want undefined weak references to __register_frame_info,
   __deregister_frame_info, _Jv_RegisterClasses and __cxa_finalize
   introduced by crtbegin.o.  The GNU linker only resolves weak
   references if they appear in a shared library.  Thus, it would be
   impossible to create a static executable if the symbols were weak.
   So, the best solution seems to be to make the symbols strong and
   provide an archive library of empty stub functions.  */
#define TARGET_ATTRIBUTE_WEAK

The other part of the story that is missing from the above is that
the HP dynamic linker doesn't support undefined weak symbols.  So,
the symbols are strong and there default implementations in a stub
archive library.  That's the origin of the warnings.

The warning could be avoided with a hppa64 specific implementation
of crtstuff.c, but the code wouldn't do anything different than it
does now.  The if's that cause the warnings are optimized away.

gcc-3.4.6 doesn't have the TARGET_ATTRIBUTE_WEAK define.  That's
the relevant difference.
Comment 7 Eric Gallager 2018-05-07 20:04:49 UTC
(In reply to littlestar from comment #5)
> (In reply to comment #3)
> > > It's known that -O2 contain "-fstrict-aliasing" which has bugs since gcc 3.X.
> > Huh?????
> 
> from 4.2.1 status report.
> PR 32182 -fstrict-aliasing ...
> PR 32327 Incorrect stack sharing...
> PR 32328 -fstrict-aliasing ...
> 
> ...

These are all closed now.
Comment 8 John David Anglin 2018-08-07 11:41:08 UTC
These warnings are not a problem.