public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/53190] New: CSE (?) CSEs asms
@ 2012-05-02 12:47 rguenth at gcc dot gnu.org
  2012-05-02 12:48 ` [Bug rtl-optimization/53190] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-02 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53190
           Summary: CSE (?) CSEs asms
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


For the attached testcase CSE ends up CSEing

(insn 2556 2555 2557 128 (parallel [
            (set (reg:DI 542 [ __res ])
                (asm_operands:DI ("cvtss2si %1, %0") ("=r") 0 [
                        (reg:SF 543)
                    ]
                     [
                        (asm_input:SF ("xm") (null):0)
                    ]
                     [] /home/aj/build/glibc/testing/math/libm-test.c:8699))
            (clobber (reg:QI 18 fpsr))
            (clobber (reg:QI 17 flags))
        ]) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 -1
     (nil))

(insn 2557 2556 2558 128 (set (reg/v:DI 403 [ __res ])
        (reg:DI 542 [ __res ])) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 62
{*movdi_internal_rex64}
     (nil))

to

(insn 2556 2555 2557 128 (set (reg:DI 542 [ __res ])
        (reg:DI 525 [ __res ])) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 62
{*movdi_internal_rex64}
     (nil))

(insn 2557 2556 2558 128 (set (reg/v:DI 403 [ __res ])
        (reg:DI 525 [ __res ])) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 62
{*movdi_internal_rex64}
     (nil))

where reg:DI 525 is computed from an asm() in a different floating-point
status area:

(insn 2479 2478 2480 127 (parallel [
            (set (reg:DI 525 [ __res ])
                (asm_operands:DI ("cvtss2si %1, %0") ("=r") 0 [
                        (reg:SF 526)
                    ]
                     [
                        (asm_input:SF ("xm") (null):0)
                    ]
                     [] /home/aj/build/glibc/testing/math/libm-test.c:8699))
            (clobber (reg:QI 18 fpsr))
            (clobber (reg:QI 17 flags))
        ]) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 -1
     (nil))

(insn 2480 2479 2481 127 (set (reg/v:DI 391 [ __res ])
        (reg:DI 525 [ __res ])) ../sysdeps/x86_64/fpu/bits/mathinline.h:82 62
{*movdi_internal_rex64}
     (nil))

the bug is sensitive to inlinign decisions and -fno-ipa-sra manages to
hide it.

Compile flags for the above is

-std=gnu99 -fgnu89-inline -O2 -fmerge-all-constants -fno-builtin

adding -frounding-math does not change anything, even if techincalli required.


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

end of thread, other threads:[~2012-05-03 11:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 12:47 [Bug rtl-optimization/53190] New: CSE (?) CSEs asms rguenth at gcc dot gnu.org
2012-05-02 12:48 ` [Bug rtl-optimization/53190] " rguenth at gcc dot gnu.org
2012-05-02 17:09 ` pinskia at gcc dot gnu.org
2012-05-02 17:28 ` ubizjak at gmail dot com
2012-05-03  8:00 ` rguenth at gcc dot gnu.org
2012-05-03  8:16 ` ubizjak at gmail dot com
2012-05-03  8:20 ` rguenther at suse dot de
2012-05-03  8:39 ` ubizjak at gmail dot com
2012-05-03  9:20 ` aj at gcc dot gnu.org
2012-05-03  9:40 ` ubizjak at gmail dot com
2012-05-03 11:03 ` aj at gcc dot gnu.org
2012-05-03 11:43 ` ubizjak at gmail dot com

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).