This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/68028] [6/7/8 regression] Compilation error "lto1: error: target attribute or pragma changes single precision floating point" with LTO on PowerPC


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68028

Nick Clifton <nickc at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at gcc dot gnu.org

--- Comment #9 from Nick Clifton <nickc at gcc dot gnu.org> ---
Created attachment 43318
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43318&action=edit
Proposed patch

Hi Guys,

Richard was right - there is code that sets extra flags based upon the setting
of -mcpu.  In fact it is just before the code he mentioned:

 /* For the E500 family of cores, reset the single/double FP flags to let us
     check that they remain constant across attributes or pragmas.  */

  switch (rs6000_cpu)
    {
    case PROCESSOR_PPC8540:
    case PROCESSOR_PPC8548:
    case PROCESSOR_PPCE500MC:
    case PROCESSOR_PPCE500MC64:
    case PROCESSOR_PPCE5500:
    case PROCESSOR_PPCE6500:
      rs6000_single_float = 0;
      rs6000_double_float = 0;
      break;

    default:
      break;
    }

This has lead me to propose the attached patch.  Basically what it does is to
tell the rs6000 backend that when it is operating in LTO mode, it should trust
the function attributes and not the command line. 

My assumption here is that if there are any discrepancies between real 
function attributes (ie not ones generated for LTO) and the command line,
then these will have been detected and reported during the original 
compilation.

What do people think ?  Is the patch OK ?

Cheers
  Nick

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]