Bug 11607 - [3.3.1 regression] Segmentation fault in gen-protos in stage2
Summary: [3.3.1 regression] Segmentation fault in gen-protos in stage2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.1
: P3 critical
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-20 17:15 UTC by John David Anglin
Modified: 2005-07-23 22:49 UTC (History)
2 users (show)

See Also:
Host: hppa64-hp-hpux11.11
Target: hppa2.0w-hp-hpux11.11
Build: hppa2.0w-hp-hpux11.11
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 John David Anglin 2003-07-20 17:15:34 UTC
./xgcc -B./ -B/opt/gnu64/hppa64-hp-hpux11.11/bin/ -isystem /opt/gnu64/hppa64-hp-
hpux11.11/include -isystem /opt/gnu64/hppa64-hp-hpux11.11/sys-include fixtmp.c -
w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
  | sed -e 's/  / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
  |  ./gen-protos >xsys-protos.hT
/bin/sh: 26493 Memory fault(coredump)

Running gen-protos under gdb, I see:

Program received signal SIGSEGV, Segmentation fault.
0x4000000000002e64 in add_hash (fname=0x800000010000ea33 "TLappend")
    at ../../gcc/gcc/gen-protos.c:44
44        if (hash_tab[i] != 0)
(gdb) printf "0x%lx\n", &hash_tab
0x8000000100000470
(gdb) printf "0x%lx\n", i
0xea5a53b
(gdb) info addr i
Symbol "i" is a variable in register r21.
(gdb) info addr hash_tab
Symbol "hash_tab" is static storage at address 0x8000000100000470.
gdb) disass 0x4000000000002e5c 0x4000000000002e6c
Dump of assembler code from 0x4000000000002e5c to 0x4000000000002e6c:
0x4000000000002e5c <add_hash+172>:      extrd,s ret0,63,32,r21
0x4000000000002e60 <add_hash+176>:      depd,z r21,61,62,r22
0x4000000000002e64 <add_hash+180>:      ldw,s r21(sr0,r24),r19
0x4000000000002e68 <add_hash+184>:
    cmpib,= 0,r19,0x4000000000002f0c <add_hash+348>
End of assembler dump.

The C code is:

  i = hashstr (fname, strlen (fname)) % HASH_SIZE;
  i0 = i;
  if (hash_tab[i] != 0)

It looks as if this failure is caused by this patch :(

2003-07-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

        PR Target/11453
        * pa.md: Disparage all mtsar constraints.
        (extzv, extv, insv): Don't fail on length of {32|64}.

This may also be the cause of the miscompilation reported in PR 11516.
Comment 1 John David Anglin 2003-07-21 15:35:19 UTC
Target problem identified.
Comment 2 GCC Commits 2003-07-23 15:18:48 UTC
Subject: Bug 11607

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	danglin@gcc.gnu.org	2003-07-23 15:18:38

Modified files:
	gcc            : ChangeLog 
	gcc/config/pa  : pa.md 

Log message:
	PR target/11607 and PR target/11516
	* pa.md (extzv, extv, insv): Revert latter half of last patch.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.683&r2=1.16114.2.684
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/pa/pa.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.116.2.10&r2=1.116.2.11

Comment 3 GCC Commits 2003-07-23 15:53:34 UTC
Subject: Bug 11607

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	danglin@gcc.gnu.org	2003-07-23 15:53:31

Modified files:
	gcc            : ChangeLog 
	gcc/config/pa  : pa.md 

Log message:
	PR target/11607 and PR target/11516
	* pa.md (extzv, extv, insv): Revert latter half of last patch.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.600&r2=2.601
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/pa/pa.md.diff?cvsroot=gcc&r1=1.127&r2=1.128

Comment 4 John David Anglin 2003-07-23 16:12:03 UTC
Fixed.
http://gcc.gnu.org/ml/gcc-patches/2003-07/msg02312.html