Bug 11983 - [3.3 Regression] ICE in dwarf-2 on code using altivec
Summary: [3.3 Regression] ICE in dwarf-2 on code using altivec
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.3.4
Assignee: Alan Modra
URL:
Keywords: ice-on-valid-code, patch
: 13148 13580 14243 (view as bug list)
Depends on:
Blocks: 11793
  Show dependency treegraph
 
Reported: 2003-08-19 21:00 UTC by agx
Modified: 2004-10-07 23:46 UTC (History)
7 users (show)

See Also:
Host: powerpc-linux
Target: powerpc-linux
Build: powerpc-linux
Known to work: 3.3 3.4.0 4.0.0 3.3.4
Known to fail: 3.3.3
Last reconfirmed: 2004-01-06 07:36:40


Attachments
preprocessed source (56.41 KB, application/gzip)
2003-08-19 21:02 UTC, agx
Details
somewhat reduced testcase (4.58 KB, application/x-gzip)
2003-08-25 15:35 UTC, Dara Hazeghi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description agx 2003-08-19 21:00:13 UTC
Hi,
this might be related to 11793, but the PR
claims that the problem is fixed in head. I'm still seeing a (though
different) ICE with -snapshot at the same line of code as in 11793:

$ /usr/lib/gcc-snapshot/bin/gcc -O4 --save-temps -ffast-math
-fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_GNU_SOURCE -maltivec -mabi=altivec -c -o ppc/mpegvideo_altivec.o
ppc/mpegvideo_altivec.c
In function `dct_quantize_altivec':

ppc/mpegvideo_altivec.c:512: internal compiler error: in
add_location_or_const_value_attribute, at dwarf2out.c:9453

The problem can again be worked around by removing the -O4 switch.
Preprocessed source is up at:
http://honk.physik.uni-konstanz.de/linux-mips/gcc/bugs/mpegvideo_altivec-snapshot.i
Please let me know if I can provide any further details.
Regards,
 -- Guido
Comment 1 agx 2003-08-19 21:02:38 UTC
Created attachment 4623 [details]
preprocessed source

I attached the preprocessed source.
Comment 2 Andrew Pinski 2003-08-19 21:57:53 UTC
The reason why I claimed it was fixed on the mainline was because I was not using linux to test it, I 
was using darwin which defaults to stabs so this most definitally a dwarf-2 debuging problem.
Comment 3 Andrew Pinski 2003-08-23 02:57:40 UTC
Removing the -g should workaround the ICE but you get no debuging symbols.
Comment 4 Dara Hazeghi 2003-08-25 14:43:55 UTC
I'm reducing this one.
Comment 5 Dara Hazeghi 2003-08-25 15:35:01 UTC
Created attachment 4652 [details]
somewhat reduced testcase

Down to 88 lines. That's probably about as far as I'll get it.
Comment 6 Andrew Pinski 2003-12-11 20:06:01 UTC
Most likely related to or the same as bug 13148.
Comment 7 Andrew Pinski 2003-12-26 01:23:55 UTC
*** Bug 13148 has been marked as a duplicate of this bug. ***
Comment 8 Andrew Pinski 2004-01-06 07:35:30 UTC
*** Bug 13580 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Pinski 2004-01-06 07:36:40 UTC
Confirmed but the somewhat reduced testcase needs to go further.
Comment 10 Andrew Pinski 2004-01-06 07:42:06 UTC
Looks like add_location_or_const_value_attribute needs to understand const_vector.
Comment 11 Andrew Pinski 2004-01-06 08:06:59 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00354.html>.
Comment 12 Andrew Pinski 2004-01-06 20:54:24 UTC
My patch does not fix it all the way and there needs to be decided how CONST_VECTOR is 
described in dwarf2
Comment 13 Andrew Pinski 2004-02-22 23:45:44 UTC
*** Bug 14243 has been marked as a duplicate of this bug. ***
Comment 14 Alan Modra 2004-03-05 12:46:25 UTC
Patch in progress
Comment 15 Andrew Pinski 2004-03-06 14:35:45 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-03/msg00598.html>.
Comment 16 GCC Commits 2004-03-07 23:42:48 UTC
Subject: Bug 11983

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	amodra@gcc.gnu.org	2004-03-07 23:42:38

Modified files:
	gcc            : ChangeLog dwarf2out.c 

Log message:
	PR debug/11983
	* dwarf2out.c (enum dw_val_class): Rename dw_val_class_float to
	dw_val_class_vec.  Replace use throughout file.
	(dw_float_const): Delete.
	(dw_vec_const): New.
	(dw_val_struct_union): Rename val_float to val_vec.  Replace use
	throughout file.
	(add_AT_vec): Rename from add_AT_float.  Add elt_size param.
	(same_dw_val_p): Adjust vec comparison.  Use memcmp.
	(size_of_die): Adjust dw_val_class_vec sizing.
	(output_die): Output dw_val_class_vec.
	(insert_int, extract_int, insert_float): New functions.
	(add_const_value_attribute): Use insert_float for CONST_DOUBLE.
	Handle CONST_VECTOR.
	(add_location_or_const_value_attribute): Handle CONST_VECTOR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3088&r2=2.3089
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.498&r2=1.499

Comment 17 Andrew Pinski 2004-03-07 23:53:48 UTC
A 3.4.0 and now a 3.3.3 regression as the fix for PR11793 just makes this one show up.
Comment 18 Alan Modra 2004-03-09 03:04:33 UTC
3.4.0 fix committed.
Comment 19 Gabriel Dos Reis 2004-03-09 03:13:10 UTC
Subject: Re:  [3.3 Regression] ICE in dwarf-2 on code using altivec

"amodra at bigpond dot net dot au" <gcc-bugzilla@gcc.gnu.org> writes:

| 3.4.0 fix committed.

Could you commit correponding versions for gcc-3_3-branch?

-- Gaby
Comment 20 Gabriel Dos Reis 2004-03-12 21:07:37 UTC
(In reply to comment #18)
> 3.4.0 fix committed.

The patch as if does not apply cleably to gcc-3_3-branch.
Do you have a version for gcc-3.3.4?  Does it worth it?

-- Gaby


Comment 21 GCC Commits 2004-03-13 09:20:21 UTC
Subject: Bug 11983

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	amodra@gcc.gnu.org	2004-03-13 09:20:16

Modified files:
	gcc            : ChangeLog dwarf2out.c 

Log message:
	PR debug/11983
	* dwarf2out.c (enum dw_val_class): Rename dw_val_class_float to
	dw_val_class_vec.  Replace use throughout file.
	(dw_float_const): Delete.
	(dw_vec_const): New.
	(dw_val_struct_union): Rename val_float to val_vec.  Replace use
	throughout file.
	(add_AT_vec): Rename from add_AT_float.  Add elt_size param.
	(same_dw_val_p): Adjust vec comparison.  Use memcmp.
	(size_of_die): Adjust dw_val_class_vec sizing.
	(output_die): Output dw_val_class_vec.
	(insert_int, extract_int, insert_float): New functions.
	(add_const_value_attribute): Use insert_float for CONST_DOUBLE.
	Handle CONST_VECTOR.
	(add_location_or_const_value_attribute): Handle CONST_VECTOR.

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.939&r2=1.16114.2.940
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.390.2.11&r2=1.390.2.12

Comment 22 Alan Modra 2004-03-13 09:22:48 UTC
Fix applied to all active branches.