Patchwork [picochip] Disable exception flags which are unnecessary on a c-only port

login
register
mail settings
Submitter Hariharan Sandanagobalane
Date Oct. 6, 2010, 11:30 a.m.
Message ID <4CAC5DC5.3030008@picochip.com>
Download mbox | patch
Permalink /patch/66904/
State New
Headers show

Comments

Hariharan Sandanagobalane - Oct. 6, 2010, 11:30 a.m.
Thanks Richard. I have now committed the modification as r165023.

Regards
Hari

ChangeLog:
         * config/picochip/picochip.c (TARGET_EXCEPT_UNWIND_INFO):
	Define it to be UI_NONE for picochip.
	(picochip_option_override): Do not disable exception flags
         * config/picochip/picochip-protos.h
	(picochip_except_unwind_info) Declare

Patch:



On 05/10/10 17:40, Richard Henderson wrote:
> On 10/05/2010 08:52 AM, Hariharan Sandanagobalane wrote:
>> The following patch disables exception flags for picochip since
>> picochip is a c-only port. Committed to mainline as r164992.
> ...
>> ChangeLog:
>>          * config/picochip/picochip.c (picochip_option_override): Disable
>>          exception flags for picochip.
>
> This change is incorrect.  Please mirror
>
> 2010-10-01  Ulrich Weigand<Ulrich.Weigand@de.ibm.com>
>
>          * config/spu/spu.c (TARGET_EXCEPT_UNWIND_INFO): Set to
>          sjlj_except_unwind_info.
>
> instead.
>
>
> r~
>
Richard Henderson - Oct. 6, 2010, 3:36 p.m.
On 10/06/2010 04:30 AM, Hariharan Sandanagobalane wrote:
> +#undef TARGET_EXCEPT_UNWIND_INFO
> +#define TARGET_EXCEPT_UNWIND_INFO picochip_except_unwind_info

Really you should be using sjlj_except_unwind_info.
Yes, your port is C only, but setjmp is C only, and
perhaps to your surprise we support some exceptions
in C as well.


r~
Hariharan Sandanagobalane - Oct. 12, 2010, 12:42 p.m.
I agree and changed appropriately. Again, Thanks a bunch for looking 
into this.

Cheers
Hari

On 06/10/10 16:36, Richard Henderson wrote:
> On 10/06/2010 04:30 AM, Hariharan Sandanagobalane wrote:
>> +#undef TARGET_EXCEPT_UNWIND_INFO
>> +#define TARGET_EXCEPT_UNWIND_INFO picochip_except_unwind_info
> Really you should be using sjlj_except_unwind_info.
> Yes, your port is C only, but setjmp is C only, and
> perhaps to your surprise we support some exceptions
> in C as well.
>
>
> r~
>

Patch

Index: gcc/config/picochip/picochip.c
===================================================================
--- gcc/config/picochip/picochip.c      (revision 165015)
+++ gcc/config/picochip/picochip.c      (working copy)
@@ -309,9 +309,18 @@ 
  #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
  #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_option_override

+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO picochip_except_unwind_info
+
  struct gcc_target targetm = TARGET_INITIALIZER;


+enum unwind_info_type
+picochip_except_unwind_info (void)
+{
+  return UI_NONE;
+}
+
  /* Only return a value in memory if it is greater than 4 bytes.
     int_size_in_bytes returns -1 for variable size objects, which go in
     memory always.  The cast to unsigned makes -1 > 8.  */
@@ -358,11 +367,6 @@ 
    if (optimize >= 1)
      flag_section_anchors = 1;

-  /* Exception flags are irrelevant to picochip. It causes failure in 
libgcc
-     functions. */
-    flag_non_call_exceptions = 0;
-    flag_exceptions = 0;
-
    /* Turn off the second scheduling pass, and move it to
       picochip_reorg, to avoid having the second jump optimisation
       trash the instruction modes (e.g., instructions are changed to
Index: gcc/config/picochip/picochip-protos.h
===================================================================
--- gcc/config/picochip/picochip-protos.h       (revision 165015)
+++ gcc/config/picochip/picochip-protos.h       (working copy)
@@ -136,6 +136,8 @@ 

  extern void picochip_asm_output_anchor (rtx symbol);

+extern enum unwind_info_type picochip_except_unwind_info (void);
+
  /* Instruction set capability flags.  These are initialised to the
     appropriate values by picochip_option_override, once the user has
     selected a CPU type. */