Bug 9493 - [3.2 regression] [HP-PA] cc1 segfaults @ -O2 when building a simple function
Summary: [3.2 regression] [HP-PA] cc1 segfaults @ -O2 when building a simple function
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.2.2
: P3 normal
Target Milestone: ---
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-01-29 08:06 UTC by Randolph Chung
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
Build: hppa-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randolph Chung 2003-01-29 08:06:00 UTC
	Self-explanatory. Compiles fine with gcc-3.0.4 and gcc-3.3 (20030118)

The segmentation fault occurs in try_forward_edges.

My initial impression is the loop

              for (; insn && GET_CODE (insn) != CODE_LABEL && !INSN_P (insn);
                   insn = NEXT_INSN (insn))
                if (GET_CODE (insn) == NOTE
                    && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
                  break;

is miscompiled.

Release:
3.2.2 20030124 (Debian prerelease) (Debian testing/unstable)

Environment:
System: Linux legolas 2.4.20-pa18 #110 Mon Jan 27 23:44:18 PST 2003 parisc unknown unknown GNU/Linux
Architecture: parisc

	<machine, os, target, libraries (multiple lines)>
host: hppa-unknown-linux-gnu
build: hppa-unknown-linux-gnu
target: hppa-unknown-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-objc-gc hppa-linux

The problem is also present on hppa2.0-hp-hpux11.11.

How-To-Repeat:
	Compile this function with gcc -O2 -c
	(simplied from a failure in building lcdproc)

void foo(int len)
{
	while (len >= 8) len -= 8;
	if(!len) return;
}
Comment 1 Randolph Chung 2003-01-29 08:06:00 UTC
Fix:
	none
Comment 2 Eric Botcazou 2003-01-29 18:10:14 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed with 3.2, 3.2.1 and 3.2.2pre.
Comment 3 Eric Botcazou 2003-02-03 13:40:34 UTC
Responsible-Changed-From-To: unassigned->ebotcazou
Responsible-Changed-Why: Patch submitted.
Comment 4 John David Anglin 2003-02-03 21:12:10 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed.
    <http://gcc.gnu.org/ml/gcc/2003-01/msg01580.html>.