public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35004]  New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
@ 2008-01-29  0:16 michael dot meissner at amd dot com
  2008-01-29  0:17 ` [Bug c++/35004] " michael dot meissner at amd dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: michael dot meissner at amd dot com @ 2008-01-29  0:16 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3411 bytes --]

If I add 4 more tree codes to tree.def, it causes a segmentation violation in
building libstdc++ pre-compiled header files.

Here is the patch to add 4 more tree codes:
--- gcc/tree.def.~1~    2007-11-01 11:59:47.000000000 -0400
+++ gcc/tree.def        2008-01-28 16:01:36.000000000 -0500
@@ -682,6 +682,13 @@ DEFTREECODE (RSHIFT_EXPR, "rshift_expr",
 DEFTREECODE (LROTATE_EXPR, "lrotate_expr", tcc_binary, 2)
 DEFTREECODE (RROTATE_EXPR, "rrotate_expr", tcc_binary, 2)

+/* Vector/vector shifts, where both arguments are vector types.  This is only
+   used during the expansion of shifts and rotates.  */
+DEFTREECODE (VLSHIFT_EXPR, "vlshift_expr", tcc_binary, 2)
+DEFTREECODE (VRSHIFT_EXPR, "vrshift_expr", tcc_binary, 2)
+DEFTREECODE (VLROTATE_EXPR, "vlrotate_expr", tcc_binary, 2)
+DEFTREECODE (VRROTATE_EXPR, "vrrotate_expr", tcc_binary, 2)
+
 /* Bitwise operations.  Operands have same mode as result.  */
 DEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", tcc_binary, 2)
 DEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", tcc_binary, 2)

Here is the file that segfaults:
        /data/fsf-build/bulldozer-gcc-test/./gcc/xgcc -shared-libgcc
-B/data/fsf-build/bulldozer-gcc-test/./gcc -nostdinc++
-L/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/src
-L/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/proj/gcc/fsf-install/bulldozer-gcc-test/x86_64-unknown-linux-gnu/bin/
-B/proj/gcc/fsf-install/bulldozer-gcc-test/x86_64-unknown-linux-gnu/lib/
-isystem
/proj/gcc/fsf-install/bulldozer-gcc-test/x86_64-unknown-linux-gnu/include
-isystem
/proj/gcc/fsf-install/bulldozer-gcc-test/x86_64-unknown-linux-gnu/sys-include
-Winvalid-pch -x c++-header -g -O2   -D_GNU_SOURCE
-I/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/proj/gcc/fsf-src/bulldozer-gcc-test/libstdc++-v3/libsupc++ -O0 -g
/proj/gcc/fsf-src/bulldozer-gcc-test/libstdc++-v3/include/precompiled/stdc++.h
-o x86_64-unknown-linux-gnu/bits/stdc++.h.gch/O0g.gch
In file included from
/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include/valarray:539,
                 from
/proj/gcc/fsf-src/bulldozer-gcc-test/libstdc++-v3/include/precompiled/stdc++.h:96:
/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include/valarray:
In instantiation of ‘std::valarray<long unsigned int>’:
/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include/bits/valarray_after.h:59:
  instantiated from here
/data/fsf-build/bulldozer-gcc-test/x86_64-unknown-linux-gnu/libstdc++-v3/include/valarray:117:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.


-- 
           Summary: Adding 4 more tree codes causes a crash in building
                    libstdc++ pre-compiled headers
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot meissner at amd dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
@ 2008-01-29  0:17 ` michael dot meissner at amd dot com
  2008-01-29  0:18 ` [Bug middle-end/35004] " michael dot meissner at amd dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: michael dot meissner at amd dot com @ 2008-01-29  0:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from michael dot meissner at amd dot com  2008-01-29 00:04 -------
Created an attachment (id=15040)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15040&action=view)
Preprocessed file from the build of the libstdc++ pre-compiled headers

File is bzip2'ed -9.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug middle-end/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
  2008-01-29  0:17 ` [Bug c++/35004] " michael dot meissner at amd dot com
@ 2008-01-29  0:18 ` michael dot meissner at amd dot com
  2008-01-29  0:19 ` [Bug c++/35004] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: michael dot meissner at amd dot com @ 2008-01-29  0:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from michael dot meissner at amd dot com  2008-01-29 00:10 -------
Created an attachment (id=15041)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15041&action=view)
Traceback for 35005


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
  2008-01-29  0:17 ` [Bug c++/35004] " michael dot meissner at amd dot com
  2008-01-29  0:18 ` [Bug middle-end/35004] " michael dot meissner at amd dot com
@ 2008-01-29  0:19 ` pinskia at gcc dot gnu dot org
  2008-01-29  1:07 ` michael dot meissner at amd dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-29  0:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-01-29 00:15 -------
I think this is the same as PR 34397 really.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |c++
           Keywords|                            |ice-on-valid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
                   ` (2 preceding siblings ...)
  2008-01-29  0:19 ` [Bug c++/35004] " pinskia at gcc dot gnu dot org
@ 2008-01-29  1:07 ` michael dot meissner at amd dot com
  2008-02-07 17:11 ` bonzini at gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: michael dot meissner at amd dot com @ 2008-01-29  1:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from michael dot meissner at amd dot com  2008-01-29 00:39 -------
Created an attachment (id=15043)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15043&action=view)
Proposed patch to fix the problem

The problem is cp/cp-tree.h stores the tree_code in 8 bits, but the tree code
now overflows.  The patch expands the tree code to 16 bits, and removes 8
unused bits to keep the padding the same.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
                   ` (3 preceding siblings ...)
  2008-01-29  1:07 ` michael dot meissner at amd dot com
@ 2008-02-07 17:11 ` bonzini at gnu dot org
  2008-02-07 17:22 ` michael dot meissner at amd dot com
  2008-12-29 14:39 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bonzini at gnu dot org @ 2008-02-07 17:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bonzini at gnu dot org  2008-02-07 17:10 -------
Unrelated, but why couldn''t vector/vector shifts/rotates overload LSHIFT_EXPR
instead? :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
                   ` (4 preceding siblings ...)
  2008-02-07 17:11 ` bonzini at gnu dot org
@ 2008-02-07 17:22 ` michael dot meissner at amd dot com
  2008-12-29 14:39 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: michael dot meissner at amd dot com @ 2008-02-07 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from michael dot meissner at amd dot com  2008-02-07 17:22 -------
Subject: RE:  Adding 4 more tree codes causes a crash in
 building libstdc++ pre-compiled headers

The problem is there are two different vector shifts.  There is vector
shift by a scalar amount (each element gets shifted the same amount),
and vector shift by a vector (each element gets shifted by the
corresponding element in the vector).

Right now, GCC in tree-vect-transform.c looks at the shift optab and
sees if the second operand is a scalar mode, it believes the machine
only supports the vector shift by scalar mode, and assumes that if the
type is vector mode, that the machine supports vector/vector shifts.

The SSE2 instruction set extension on the x86 has vector/scalar shift
instructions, and the SSE5 instruction set extension adds vector/vector
shifts and rotates.  I want to be able to add support for a machine that
has both types of vector shift, but with the current framework, this was
impossible.

--
Michael Meissner
AMD, MS 83-29
90 Central Street
Boxborough, MA 01719

> -----Original Message-----
> From: bonzini at gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org]
> Sent: Thursday, February 07, 2008 12:11 PM
> To: Meissner, Michael
> Subject: [Bug c++/35004] Adding 4 more tree codes causes a crash in
> building libstdc++ pre-compiled headers
> 
> 
> 
> ------- Comment #5 from bonzini at gnu dot org  2008-02-07 17:10
-------
> Unrelated, but why couldn''t vector/vector shifts/rotates overload
> LSHIFT_EXPR
> instead? :-)
> 
> 
> --
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/35004] Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers
  2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
                   ` (5 preceding siblings ...)
  2008-02-07 17:22 ` michael dot meissner at amd dot com
@ 2008-12-29 14:39 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 14:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-12-29 14:37 -------
Fixed:
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 131942)
+++ ChangeLog   (revision 131943)
@@ -1,3 +1,10 @@
+2008-01-29  Michael Meissner  <michael.meissner@amd.com>
+
+       PR 35004
+       * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
+       bits to allow for expansion of the number of middle end tree
+       codes.
+


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35004


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-12-29 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29  0:16 [Bug c++/35004] New: Adding 4 more tree codes causes a crash in building libstdc++ pre-compiled headers michael dot meissner at amd dot com
2008-01-29  0:17 ` [Bug c++/35004] " michael dot meissner at amd dot com
2008-01-29  0:18 ` [Bug middle-end/35004] " michael dot meissner at amd dot com
2008-01-29  0:19 ` [Bug c++/35004] " pinskia at gcc dot gnu dot org
2008-01-29  1:07 ` michael dot meissner at amd dot com
2008-02-07 17:11 ` bonzini at gnu dot org
2008-02-07 17:22 ` michael dot meissner at amd dot com
2008-12-29 14:39 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).