public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/46041] New: __FP_FAST_FMA not defined with -E
@ 2010-10-15 22:57 rth at gcc dot gnu.org
  2010-10-15 22:59 ` [Bug c/46041] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: rth at gcc dot gnu.org @ 2010-10-15 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: __FP_FAST_FMA not defined with -E
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rth@gcc.gnu.org


The test

  optab_handler (fma_optab, mode) != CODE_FOR_nothing

always fails with -E because we never proceed that far.  See

do_compile:
      /* Language-dependent initialization.  Returns true on success.  */
      if (lang_dependent_init (main_input_filename))
        compile_file ();

c_common_init:
  if (flag_preprocess_only)
    {
      finish_options ();
      preprocess_file (parse_in);
      return false;
    }


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
@ 2010-10-15 22:59 ` pinskia at gcc dot gnu.org
  2010-10-15 23:01 ` rth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-15 22:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-15 22:59:10 UTC ---
Doesn't that mean -save-temps is also broken?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
  2010-10-15 22:59 ` [Bug c/46041] " pinskia at gcc dot gnu.org
@ 2010-10-15 23:01 ` rth at gcc dot gnu.org
  2010-10-15 23:02 ` rth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rth at gcc dot gnu.org @ 2010-10-15 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Henderson <rth at gcc dot gnu.org> 2010-10-15 23:01:19 UTC ---
I think the easiest solution is to simply do

  switch (mode)
    {
    case SFmode:
#ifdef HAVE_fmasf4
      return HAVE_fmasf4;
#endif
      break;
    ...
    }
  return false;

instead of the optab_handler lookup.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
  2010-10-15 22:59 ` [Bug c/46041] " pinskia at gcc dot gnu.org
  2010-10-15 23:01 ` rth at gcc dot gnu.org
@ 2010-10-15 23:02 ` rth at gcc dot gnu.org
  2010-10-16  9:43 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rth at gcc dot gnu.org @ 2010-10-15 23:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> 2010-10-15 23:02:26 UTC ---
(In reply to comment #1)
> Doesn't that mean -save-temps is also broken?

Yes.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-10-15 23:02 ` rth at gcc dot gnu.org
@ 2010-10-16  9:43 ` rguenth at gcc dot gnu.org
  2010-10-18 15:12 ` meissner at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-10-16  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-10-16 09:43:25 UTC ---
Hm, the question is if it is a good idea anyway given the target and
optimization
attributes.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2010-10-16  9:43 ` rguenth at gcc dot gnu.org
@ 2010-10-18 15:12 ` meissner at gcc dot gnu.org
  2010-10-18 15:26 ` meissner at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2010-10-18 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.18 15:11:54
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2010-10-18 15:12 ` meissner at gcc dot gnu.org
@ 2010-10-18 15:26 ` meissner at gcc dot gnu.org
  2010-10-18 16:12 ` rth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2010-10-18 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-10-18 15:11:54         |
         AssignedTo|unassigned at gcc dot       |meissner at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from Michael Meissner <meissner at gcc dot gnu.org> 2010-10-18 15:26:13 UTC ---
Yes, -save-temps would be broken.  I noticed this after submitting the bug when
I tried to patch glibc's math.h and I happened to use -save-temps, and it
didn't seem to work, and I was just about to investigate it when I needed to go
home.

The suggestion to use HAVE_fma<mode>4 instead of the check on the builtin array
will probably work for normal -save-temps.  However, for target specific
functions, we may need to go to using a conditional macro for these.

However, Richard Guenther has a point, that it really doesn't work too well
when you consider target specific attributes.  Frankly, I hadn't thought about
-save-temps when I first contemplated target attributes in the first place
(even though I originally added -save-temps many years ago).  The -save-temps
switch doesn't work in general when functions have different target attributes
that will change the macros being defined.  I would imagine -E would have the
same problem.  The only way I can see to do this 'right' is to move -save-temps
into the cpp handling in the compiler proper, rather than doing two passes like
we do now. In the old days, we had to do two passes, because cpp was a separate
process.

While this might fix -save-temps, I'm still not sure what we can do about -E.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2010-10-18 15:26 ` meissner at gcc dot gnu.org
@ 2010-10-18 16:12 ` rth at gcc dot gnu.org
  2010-10-18 16:21 ` meissner at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rth at gcc dot gnu.org @ 2010-10-18 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Henderson <rth at gcc dot gnu.org> 2010-10-18 16:12:21 UTC ---
Does anyone honestly expect a pre-processor macro to change due to
attributes on a function?  I sure don't -- that would seem to be a
clear translation phase ordering violation.

Setting __FP_FAST_FMA based on the command-line compiler options
only would seem to be to be Good Enough.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2010-10-18 16:12 ` rth at gcc dot gnu.org
@ 2010-10-18 16:21 ` meissner at gcc dot gnu.org
  2010-10-18 20:01 ` meissner at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2010-10-18 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Michael Meissner <meissner at gcc dot gnu.org> 2010-10-18 16:21:31 UTC ---
Yes, though the issue originally came up in terms of the pragma and not the
attribute, because people wanted to include the various include files that had
#ifdef's to guard against builtin functions if the target switches weren't
used.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2010-10-18 16:21 ` meissner at gcc dot gnu.org
@ 2010-10-18 20:01 ` meissner at gcc dot gnu.org
  2010-10-18 22:37 ` meissner at gcc dot gnu.org
  2011-12-09 18:38 ` meissner at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2010-10-18 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Michael Meissner <meissner at gcc dot gnu.org> 2010-10-18 20:01:24 UTC ---
Created attachment 22083
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22083
Patch that redefines mode_has_fma so that it works with -save-temps


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2010-10-18 20:01 ` meissner at gcc dot gnu.org
@ 2010-10-18 22:37 ` meissner at gcc dot gnu.org
  2011-12-09 18:38 ` meissner at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2010-10-18 22:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Michael Meissner <meissner at gcc dot gnu.org> 2010-10-18 22:37:36 UTC ---
Author: meissner
Date: Mon Oct 18 22:37:32 2010
New Revision: 165666

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165666
Log:
Fix PR 46041

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-cppbuiltin.c
    trunk/gcc/tree.h


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/46041] __FP_FAST_FMA not defined with -E
  2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2010-10-18 22:37 ` meissner at gcc dot gnu.org
@ 2011-12-09 18:38 ` meissner at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: meissner at gcc dot gnu.org @ 2011-12-09 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

Michael Meissner <meissner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #10 from Michael Meissner <meissner at gcc dot gnu.org> 2011-12-09 18:34:15 UTC ---
Fixed on October 18th, 2010.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-12-09 18:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15 22:57 [Bug c/46041] New: __FP_FAST_FMA not defined with -E rth at gcc dot gnu.org
2010-10-15 22:59 ` [Bug c/46041] " pinskia at gcc dot gnu.org
2010-10-15 23:01 ` rth at gcc dot gnu.org
2010-10-15 23:02 ` rth at gcc dot gnu.org
2010-10-16  9:43 ` rguenth at gcc dot gnu.org
2010-10-18 15:12 ` meissner at gcc dot gnu.org
2010-10-18 15:26 ` meissner at gcc dot gnu.org
2010-10-18 16:12 ` rth at gcc dot gnu.org
2010-10-18 16:21 ` meissner at gcc dot gnu.org
2010-10-18 20:01 ` meissner at gcc dot gnu.org
2010-10-18 22:37 ` meissner at gcc dot gnu.org
2011-12-09 18:38 ` meissner at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).