This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11975] New: gcc miscompiles natClassLoader.cc with -fnon-call-exceptions
- From: "tausq at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2003 05:11:18 -0000
- Subject: [Bug optimization/11975] New: gcc miscompiles natClassLoader.cc with -fnon-call-exceptions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11975
Summary: gcc miscompiles natClassLoader.cc with -fnon-call-
exceptions
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tausq at debian dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: hppa-unknown-linux
GCC host triplet: hppa-unknown-linux
GCC target triplet: hppa-unknown-linux
While trying to build libjava for hppa-linux, i ran into a few cases where gcc
built code that segfaults when run. One example is attached -- this code was
extracted from natClassLoader.cc, when built with -fnon-call-exceptions, gcc
emits an insn:
ldw RT'loaded_classes(%r25),%r25
but r25 is never initialized. It looks like the gcse pass eliminated the
initialization of r25
The complete build command was:
gcc -fno-rtti -fdollars-in-identifiers -Wswitch-enum -fnon-call-exceptions -O2
-g -fPIC -S bug.ii
With -fno-gcse, the code looks like:
.loc 1 48 0
addil LT'loaded_classes,%r19
ldw RT'loaded_classes(%r1),%r1
without -fno-gcse
.loc 1 48 0
ldw RT'loaded_classes(%r25),%r25