[Bug c++/56518] Segmentation fault

2013-03-04 Thread elisey.zanko at gmail dot com


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



--- Comment #1 from Elisey Zanko elisey.zanko at gmail dot com 2013-03-04 
11:10:09 UTC ---

Created attachment 29579

  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29579

A preprocessed file causing bug


[Bug c++/56518] Segmentation fault

2013-03-04 Thread paolo.carlini at oracle dot com


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



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 CC|elisey.zanko at gmail dot   |

   |com |

  Known to work||4.7.0, 4.8.0

 Resolution||WORKSFORME



--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com 2013-03-04 
11:20:01 UTC ---

Both 4.7 and mainline are fine.


[Bug c++/56518] Segmentation fault

2013-03-04 Thread rguenth at gcc dot gnu.org


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



Richard Biener rguenth at gcc dot gnu.org changed:



   What|Removed |Added



 Resolution|WORKSFORME  |FIXED

  Known to fail||4.6.4



--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org 2013-03-04 
12:52:43 UTC ---

The ICE is



#0  0x007bafa2 in c_common_signed_or_unsigned_type (unsignedp=1, 

type=0x0)

at /space/rguenther/src/svn/gcc-4_6-branch/gcc/c-family/c-common.c:3018

#1  0x007bfe47 in shorten_compare (op0_ptr=0x7fffcb80, 

op1_ptr=0x7fffcb78, restype_ptr=0x7fffcb70, 

rescode_ptr=0x7fffcb6c)

at /space/rguenther/src/svn/gcc-4_6-branch/gcc/c-family/c-common.c:3567



3562  else if (unsignedp0 == unsignedp1  real1 == real2

3563TYPE_PRECISION (TREE_TYPE (primop0))  TYPE_PRECISION

(*restype_ptr)

3564TYPE_PRECISION (TREE_TYPE (primop1))  TYPE_PRECISION

(*restype_ptr))

3565{

3566  type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1));

3567  type = c_common_signed_or_unsigned_type (unsignedp0

3568   || TYPE_UNSIGNED

(*restype_ptr),

3569   type);



which ends up calling cp_common_type which has (still also on trunk):



static tree

cp_common_type (tree t1, tree t2)

{

...

  if (SCOPED_ENUM_P (t1) || SCOPED_ENUM_P (t2))

{

  if (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))

return build_type_attribute_variant (t1, attributes);

  else

return NULL_TREE;

}



but common_type () is not expected to return NULL_TREE.



ISTR this bug, it got fixed for 4.7+.