------- Comment #2 from gnu at the-meissners dot org  2008-07-24 18:26 -------
Subject: Re:  [4.4 regression] Bootstrap failure on
        sparc: assertion failure in options.c

On Thu, Jul 24, 2008 at 05:21:10PM -0000, ro at gcc dot gnu dot org wrote:
> 
> 
> ------- Comment #1 from ro at gcc dot gnu dot org  2008-07-24 17:21 -------
> Michael, could you have a look?  This seems to have been introduced by this
> change:
> 
> 2008-07-23  Michael Meissner  <[EMAIL PROTECTED]>
>             Karthik Kumar  <[EMAIL PROTECTED]>
> [...]
>         * optc-gen.awk: Add support for TargetSave to allow a back end to
>         declare new fields that need to be saved when using function
>         specific options.  Include flags.h and target.h in the options.c
>         source.  Add support for Save to indicate which options can be set
>         for individual functions.  Generate cl_optimize_save,
>         cl_optimize_restore, cl_optimize_print, cl_target_option_save,
>         cl_target_option_restore, cl_target_option_print functions to
>         allow functions to use different optimization or target options.
> 
> and sparc-sun-solaris2.10 is primary platform for 4.4.
> 
> 
> -- 
> 
> ro at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |gnu at the-meissners dot org
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36918
> 
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.

This is due to DEFAULT_PCC_STRUCT_RETURN being defined as -1.  The code to
store and restore optimization options is trying to use smaller amount of
space, and so it stores the flag values into an unsigned byte instead of an
int.  The code in question is doing an assert to make sure that the value is in
range, so that when the value is restored, it get the same value.

Three possible solutions exist:
1) In sparc.h change DEFAULT_PCC_STRUCT_RETURN to be 2 instead of -1;
2) Change the default space to be signed bytes instead of unsigned;
3) Save ints instead of bytes and don't try to save space.


-- 


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

Reply via email to