public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/27277]  New: standard i387 constant loading insns (fldz, fld1) are not generated anymore
@ 2006-04-24  8:42 uros at kss-loka dot si
  2006-04-24  8:50 ` [Bug target/27277] " pluto at agmk dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: uros at kss-loka dot si @ 2006-04-24  8:42 UTC (permalink / raw)
  To: gcc-bugs

It looks that standard i387 constant loading insns are not generated anymore.
This testcase:

--cut here--
double test(void)
{
   return 1.0;
}
--cut here--

generates (gcc -O2 -fomit-frame-pointer):
test:
        flds    .LC0            <<<< fld1 should be here
        ret

.LC0:
        .long   1065353216

The problem is in extendsfdf2 expander, which expects CONST_DOUBLE as an
operand[1] to generate simple constant move instruction. The constant is pushed
to the constant pool (as a SFmode constant) for some reason, so the expander
receives a (reg:SF 60) as an operand[1]. Following RTL sequence is produced:

(insn 9 8 10 (set (reg:SF 60)
        (mem/u/c/i:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [2 S4 A32])) -1
(nil)
    (expr_list:REG_EQUAL (const_double:SF 1.0e+0 [0x0.8p+1])
        (nil)))

(insn 10 9 11 (set (reg:DF 58 [ <result> ])
        (float_extend:DF (reg:SF 60))) -1 (nil)
    (expr_list:REG_EQUAL (const_double:DF 1.0e+0 [0x0.8p+1])
        (nil)))

this sequence corresponds to final asm:

test:
        flds    .LC0    # 16    *extendsfdf2_i387/1     [length = 6]
        ret     # 30    return_internal [length = 1]

The same problem arises for other i387 constants.


-- 
           Summary: standard i387 constant loading insns (fldz, fld1) are
                    not generated anymore
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uros at kss-loka dot si
GCC target triplet: i386-pc-linux-gnu


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


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

* [Bug target/27277] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
@ 2006-04-24  8:50 ` pluto at agmk dot net
  2006-05-02  4:54 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pluto at agmk dot net @ 2006-04-24  8:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pluto at agmk dot net  2006-04-24 08:50 -------
PR26915 seems to be related to this bug.


-- 

pluto at agmk dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pluto at agmk dot net


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


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

* [Bug target/27277] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
  2006-04-24  8:50 ` [Bug target/27277] " pluto at agmk dot net
@ 2006-05-02  4:54 ` pinskia at gcc dot gnu dot org
  2006-05-02  4:59 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-02  4:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-05-02 04:54 -------
It worked with "4.2.0 20060409" with a cross compiler from x86_64-linux-gnu to
i686-linux-gnu.


-- 


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


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

* [Bug target/27277] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
  2006-04-24  8:50 ` [Bug target/27277] " pluto at agmk dot net
  2006-05-02  4:54 ` pinskia at gcc dot gnu dot org
@ 2006-05-02  4:59 ` pinskia at gcc dot gnu dot org
  2006-05-02  5:41 ` [Bug target/27277] [4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-02  4:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-05-02 04:59 -------
(In reply to comment #1)
> PR26915 seems to be related to this bug.

Not really as this one was working in 4.1.0 and that is about doing an extra
instruction for smaller size.


-- 


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


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

* [Bug target/27277] [4.2 Regression] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
                   ` (2 preceding siblings ...)
  2006-05-02  4:59 ` pinskia at gcc dot gnu dot org
@ 2006-05-02  5:41 ` pinskia at gcc dot gnu dot org
  2006-05-08  6:10 ` uros at gcc dot gnu dot org
  2006-05-08  6:12 ` uros at kss-loka dot si
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-02  5:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-05-02 05:41 -------
Confirmed.  I want to say this was caused by:
2006-04-03  Paolo Bonzini  <bonzini@gnu.org>
            Dale Johannesen  <dalej@apple.com>

        PR target/19653
        * regclass.c (struct reg_pref): Update documentation.
        (regclass): Set prefclass to NO_REGS if memory is the best option.
        (record_reg_classes): Cope with a prefclass set to NO_REGS.
        * reload.c (find_reloads): Take PREFERRED_OUTPUT_RELOAD_CLASS
        into account.  For non-registers, equate an empty preferred
        reload class to a `!' in the constraint; move the if clause to
        do so after those that reject the insn.
        (push_reload): Allow PREFERRED_*_RELOAD_CLASS to liberally
        return NO_REGS.
        (find_dummy_reload): Likewise.
        * doc/tm.texi (Register Classes): Document what it means
        if PREFERRED_*_RELOAD_CLASS return NO_REGS.
        * config/i386/i386.c (ix86_preferred_reload_class): Force
        using SSE registers (and return NO_REGS for floating-point
        constants) if math is done with SSE.
        (ix86_preferred_output_reload_class): New.
        * config/i386/i386-protos.h (ix86_preferred_output_reload_class): New.
        * config/i386/i386.h (PREFERRED_OUTPUT_RELOAD_CLASS): New.
        * config/i386/i386.md: Remove # register preferences.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini at gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-02 05:41:52
               date|                            |
            Summary|standard i387 constant      |[4.2 Regression] standard
                   |loading insns (fldz, fld1)  |i387 constant loading insns
                   |are not generated anymore   |(fldz, fld1) are not
                   |                            |generated anymore
   Target Milestone|---                         |4.2.0


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


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

* [Bug target/27277] [4.2 Regression] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
                   ` (3 preceding siblings ...)
  2006-05-02  5:41 ` [Bug target/27277] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-05-08  6:10 ` uros at gcc dot gnu dot org
  2006-05-08  6:12 ` uros at kss-loka dot si
  5 siblings, 0 replies; 7+ messages in thread
From: uros at gcc dot gnu dot org @ 2006-05-08  6:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from uros at gcc dot gnu dot org  2006-05-08 06:10 -------
Subject: Bug 27277

Author: uros
Date: Mon May  8 06:10:03 2006
New Revision: 113622

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113622
Log:
        PR target/27277
        * config/i386/i386.c (ix86_rtx_costs) [FLOAT_EXTEND]: For
        standard 80387 constants, raise the cost to prevent
        compress_float_constant() to generate load from memory.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c


-- 


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


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

* [Bug target/27277] [4.2 Regression] standard i387 constant loading insns (fldz, fld1) are not generated anymore
  2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
                   ` (4 preceding siblings ...)
  2006-05-08  6:10 ` uros at gcc dot gnu dot org
@ 2006-05-08  6:12 ` uros at kss-loka dot si
  5 siblings, 0 replies; 7+ messages in thread
From: uros at kss-loka dot si @ 2006-05-08  6:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from uros at kss-loka dot si  2006-05-08 06:12 -------
Fixed.


-- 

uros at kss-loka dot si changed:

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


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


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

end of thread, other threads:[~2006-05-08  6:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-24  8:42 [Bug target/27277] New: standard i387 constant loading insns (fldz, fld1) are not generated anymore uros at kss-loka dot si
2006-04-24  8:50 ` [Bug target/27277] " pluto at agmk dot net
2006-05-02  4:54 ` pinskia at gcc dot gnu dot org
2006-05-02  4:59 ` pinskia at gcc dot gnu dot org
2006-05-02  5:41 ` [Bug target/27277] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-05-08  6:10 ` uros at gcc dot gnu dot org
2006-05-08  6:12 ` uros at kss-loka dot si

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