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

--- Comment #5 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Vincent Lefèvre from comment #4)
> (In reply to Kewen Lin from comment #3)
> > Thanks for reporting, this exposes one issue that: when encoding KFmode
> > constant into toc, it uses the format for the current long double, it could
> > be wrong if the current long double is with IBM format instead of IEEE
> > format. I have a patch.
> 
> OK, but why does an explicit `-mfull-toc` make this issue appear while this
> is documented to be the default?

Good question, the reason is that we actually don't put fp in toc for
-mcmodel=medium if -mfp-in-toc (or -mfull-toc) isn't explicitly specified,
since we can address them efficiently even outside the TOC.

Some codes like:

      if (rs6000_current_cmodel != CMODEL_SMALL)
        {
          if (!OPTION_SET_P (TARGET_NO_FP_IN_TOC))
            TARGET_NO_FP_IN_TOC = rs6000_current_cmodel == CMODEL_MEDIUM;
          if (!OPTION_SET_P (TARGET_NO_SUM_IN_TOC))
            TARGET_NO_SUM_IN_TOC = 0;
        }

I think you can still see the wrong constant if not specifying -mfull-toc but
with the specified -mcmodel=small (or large). Anyway, IMHO the documentation
also needs some updates.

Reply via email to