Bug 47458 - m32r fails to build -- __builtin_eh_return not supported
Summary: m32r fails to build -- __builtin_eh_return not supported
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 15:05 UTC by Joel Sherrill
Modified: 2011-01-25 16:45 UTC (History)
0 users

See Also:
Host:
Target: m32r-*-rtems*
Build:
Known to work: 4.5.2
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Sherrill 2011-01-25 15:05:28 UTC
4.6.0 20110110 (experimental) [trunk revision 168642]

/users/joel/test-gcc/b-gcc1-m32r/./gcc/xgcc -B/users/joel/test-gcc/b-gcc1-m32r/./gcc/ -nostdinc -B/users/joel/test-gcc/b-gcc1-m32r/m32r-rtems4.11/newlib/ -isystem /users/joel/test-gcc/b-gcc1-m32r/m32r-rtems4.11/newlib/targ-include -isystem /users/joel/test-gcc/gcc-svn/newlib/libc/include -B/users/joel/test-gcc/install-svn/m32r-rtems4.11/bin/ -B/users/joel/test-gcc/install-svn/m32r-rtems4.11/lib/ -isystem /users/joel/test-gcc/install-svn/m32r-rtems4.11/include -isystem /users/joel/test-gcc/install-svn/m32r-rtems4.11/sys-include    -g -Os -mmodel=medium -msdata=sdata -O2 -I/users/joel/test-gcc/gcc-svn/gcc/../newlib/libc/sys/rtems/include -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -G 0 -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I/users/joel/test-gcc/gcc-svn/libgcc -I/users/joel/test-gcc/gcc-svn/libgcc/. -I/users/joel/test-gcc/gcc-svn/libgcc/../gcc -I/users/joel/test-gcc/gcc-svn/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c /users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind-dw2.c 
In file included from /users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind-dw2.c:1582:0:
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc: In function '_Unwind_RaiseException':
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc:136:1: error: __builtin_eh_return not supported on this target
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc: In function '_Unwind_ForcedUnwind':
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc:212:1: error: __builtin_eh_return not supported on this target
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume':
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc:237:1: error: __builtin_eh_return not supported on this target
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume_or_Rethrow':
/users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc:262:1: error: __builtin_eh_return not supported on this target
make[4]: *** [unwind-dw2.o] Error 1
make[4]: Leaving directory `/users/joel/test-gcc/b-gcc1-m32r/m32r-rtems4.11/medium/libgcc'
make[3]: *** [multi-do] Error 1
Comment 1 froydnj@codesourcery.com 2011-01-25 15:08:48 UTC
On Tue, Jan 25, 2011 at 03:05:32PM +0000, joel at gcc dot gnu.org wrote:
> In file included from
> /users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind-dw2.c:1582:0:
> /users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc: In function
> '_Unwind_RaiseException':
> /users/joel/test-gcc/gcc-svn/libgcc/../gcc/unwind.inc:136:1: error:
> __builtin_eh_return not supported on this target

This means that m32r (and m32c, at least) need to undef/define
TARGET_EXCEPT_UNWIND_INFO in m32r.c to sjlj_except_unwind_info.
Comment 2 Joel Sherrill 2011-01-25 16:19:28 UTC
I can now build C/C++ for m32r-rtems*.  

m32c-rtems* builds ok without any patches.

OK to commit this and close this PR?

Index: gcc/config/m32r/m32r.c
===================================================================
--- gcc/config/m32r/m32r.c	(revision 169182)
+++ gcc/config/m32r/m32r.c	(working copy)
@@ -1,6 +1,6 @@
 /* Subroutines used for code generation on the Renesas M32R cpu.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
@@ -210,6 +210,9 @@
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT m32r_trampoline_init
 
+#undef  TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO		sjlj_except_unwind_info
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 

 /* Implement TARGET_HANDLE_OPTION.  */
Comment 3 froydnj@codesourcery.com 2011-01-25 16:26:42 UTC
On Tue, Jan 25, 2011 at 04:19:33PM +0000, joel at gcc dot gnu.org wrote:
> I can now build C/C++ for m32r-rtems*.  
> 
> m32c-rtems* builds ok without any patches.
> 
> OK to commit this and close this PR?

I'm not a maintainer, but given that a number of architectures have been
fixed in this manner this release cycle, I think this counts as obvious.
Comment 4 Richard Biener 2011-01-25 16:29:26 UTC
Looks obvious.
Comment 5 Joel Sherrill 2011-01-25 16:45:35 UTC
Patch committed to head as revision 169242. 

Thanks for the advice.