Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

-ffast-math -O2 -fplugin-arg-dragonegg-enable-gcc-optzns fails to compile aermod.f90 #10048

Closed Quuxplusone closed 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR9716
Status RESOLVED DUPLICATE of bug 2314
Importance P normal
Reported by Jack Howarth (howarth.mailing.lists@gmail.com)
Reported on 2011-04-13 20:27:48 -0700
Last modified on 2011-06-07 09:54:51 -0700
Version trunk
Hardware Macintosh MacOS X
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments aermod_reduced.f90 (80670 bytes, text/plain)
Blocks
Blocked by
See also
The aermod.f90 Polyhedron 2005 benchmark fails to compile with -ffast-math -O2 -
fplugin-arg-dragonegg-enable-gcc-optzns using dragonegg trunk svn at r129460
on x86_64-apple-darwin10. The compilation fails as...

[MacPro:pb05/lin/source] howarth% /sw/lib/gcc4.5/bin/gfortran -
fplugin=/sw/lib/gcc4.5/lib/dragonegg.so -ffast-math -O2 -fplugin-arg-dragonegg-
enable-gcc-optzns aermod.f90 -o aermod
aermod.f90: In function ‘refl_ht_’:
aermod.f90:7219:0: error: unsupported target builtin ‘__builtin_ia32_rsqrtf’
used
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | dragonegg
PLUGIN_FINISH                    | dragonegg
PLUGIN_START_UNIT                | dragonegg
aermod.f90:7123: confused by earlier errors, bailing out

This error is also triggered by just  -funsafe-math-optimizations -ffinite-math-
only -O2 -fplugin-arg-dragonegg-enable-gcc-optzns.
Quuxplusone commented 13 years ago
Also seen with gas_dyn at -O3 -fplugin-arg-dragonegg-enable-gcc-optzns...

[MacPro:pb05/lin/source] howarth% /sw/lib/gcc4.5/bin/gfortran -
fplugin=/sw/lib/gcc4.5/lib/dragonegg.so -msse3 -O3 -fplugin-arg-dragonegg-
enable-gcc-optzns gas_dyn.f90 -o gas_dyn
gas_dyn.f90: In function ‘eos_’:
gas_dyn.f90:410:0: error: unsupported target builtin ‘__builtin_ia32_sqrtps_nr’
used
gas_dyn.f90:431:0: error: unsupported target builtin ‘__builtin_ia32_sqrtps_nr’
used
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | dragonegg
PLUGIN_FINISH                    | dragonegg
PLUGIN_START_UNIT                | dragonegg
gas_dyn.f90:1818: confused by earlier errors, bailing out
Quuxplusone commented 13 years ago

Note that is PR is the only blocker from -O2 -ffast-math -fplugin-arg-dragonegg-enable-gcc-optzns completely passing the Polyhedron 2005 benchmarks.

Quuxplusone commented 13 years ago
If...

------------------------------------------------------------------------
r132119 | baldrick | 2011-05-26 06:25:08 -0400 (Thu, 26 May 2011) | 2 lines

Untested support for a couple of x86 sqrt builtins (no testcase).

was meant to address this PR, it still isn't working...

[MacPro:pb05/lin/source] howarth% /sw/lib/gcc4.5/bin/gfortran -
fplugin=/sw/lib/gcc4.5/lib/dragonegg.so -msse3 -O3 -fplugin-arg-dragonegg-
enable-gcc-optzns gas_dyn.f90 -o gas_dyn
gas_dyn.f90: In function ‘eos_’:
gas_dyn.f90:410:0: error: unsupported target builtin ‘__builtin_ia32_sqrtps_nr’
used
gas_dyn.f90:431:0: error: unsupported target builtin ‘__builtin_ia32_sqrtps_nr’
used
Quuxplusone commented 13 years ago
It wasn't: notice that that was for sqrtps, while this is for sqrtps_nr (i.e.
sqrtps followed by a Newton-Raphson step to improve precision).
Quuxplusone commented 13 years ago

Attached aermod_reduced.f90 (80670 bytes, text/plain): reduced test case

Quuxplusone commented 13 years ago

_Bug 9710 has been marked as a duplicate of this bug._

Quuxplusone commented 13 years ago
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110530/121742.html

fixes -O3 -fplugin-arg-dragonegg-enable-gcc-optzns compilation of aermod.f90,
but
-ffast-math -O3 -fplugin-arg-dragonegg-enable-gcc-optzns now fails as...

[MacPro:pb05/lin/source] howarth% de-gfortran45 -msse3 -ffast-math -O3 -fplugin-
arg-dragonegg-enable-gcc-optzns aermod.f90 -o aermod
aermod.f90: In function ‘refl_ht_’:
aermod.f90:7219:0: error: unsupported target builtin ‘__builtin_ia32_rsqrtf’
used
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | dragonegg
PLUGIN_FINISH                    | dragonegg
PLUGIN_START_UNIT                | dragonegg
aermod.f90:7123: confused by earlier errors, bailing out
Quuxplusone commented 13 years ago

Should I open up a new PR for the missing ‘__builtin_ia32_rsqrtf?

Quuxplusone commented 13 years ago

No, I'm happy to consider it part of this bug report.

Quuxplusone commented 13 years ago

Although rsqrtps_nr is now implemented, aermod is still missing rsqrtf.

Quuxplusone commented 13 years ago

That is why I didn't close this bug report yet :)

Quuxplusone commented 13 years ago
Support for rsqrtf was added here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110606/121968.html
Quuxplusone commented 13 years ago
At r132710, the failure changes to...

[MacPro-2:pb05/lin/source] howarth% de-gfortran45 -msse3 -ffast-math -O3 -
fplugin-arg-dragonegg-enable-gcc-optzns aermod.f90 -o aermod
UNREACHABLE executed!
Stack dump:
0.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@hrloop_'
*** WARNING *** there are active plugins, do not report this as a bug unless
you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | dragonegg
PLUGIN_FINISH                    | dragonegg
PLUGIN_START_UNIT                | dragonegg
aermod.f90:51843:0: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Quuxplusone commented 13 years ago

It compiles here, with latest LLVM from svn. Maybe you are hitting PR2314?

Quuxplusone commented 13 years ago
(In reply to comment #14)
> It compiles here, with latest LLVM from svn.  Maybe you are hitting PR2314?

Yes. Does PR2314 not impact linux? FYI, I add -fno-tree-vectorize, the error is
suppressed.
Quuxplusone commented 13 years ago
My mistake, I forgot to add -fplugin-arg-dragonegg-enable-gcc-optzns (!).
Yes, this is PR2314.

_This bug has been marked as a duplicate of bug 2314_