public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/47580] New: Powerpc GCC fails test gcc.dg/pr41551.c if built with --with-cpu=power7
@ 2011-02-01 20:43 meissner at gcc dot gnu.org
  2011-02-01 20:46 ` [Bug target/47580] " meissner at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: meissner at gcc dot gnu.org @ 2011-02-01 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Powerpc GCC fails test gcc.dg/pr41551.c if built with
                    --with-cpu=power7
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: meissner@gcc.gnu.org
        ReportedBy: meissner@gcc.gnu.org
              Host: powerpc64-linux
            Target: powerpc64-linux
             Build: powerpc64-linux


Test gcc.dg/pr41551.c fails for powerpc if the default target is power7.

This is due to the fact that the expander for floatunsdidf (and others) uses
gpc_reg_operand:

(define_expand "floatunsdidf2"
  [(set (match_operand:DF 0 "gpc_reg_operand" "")
    (unsigned_float:DF
     (match_operand:DI 1 "gpc_reg_operand" "")))]
  "TARGET_HARD_FLOAT && (TARGET_FCFIDU || VECTOR_UNIT_VSX_P (DFmode))"
  "")

However, the corresponding VSX matcher uses vsx_register_operand:
(define_insn "vsx_floatuns<VSi><mode>2"
  [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
    (unsigned_float:VSX_B (match_operand:<VSI> 1 "vsx_register_operand"
"<VSr2>,<VSr3>")))]
  "VECTOR_UNIT_VSX_P (<MODE>mode)"
  "x<VSv>cvux<VSc><VSs> %x0,%x1"
  [(set_attr "type" "<VStype_simple>")
   (set_attr "fp_type" "<VSfptype_simple>")])

Gpc_reg_operand allows the virtual stack registers while vsx_register_operand
does not.  Since the test is:

__extension__ typedef __SIZE_TYPE__ size_t;

int main(void)
{
 int var, *p = &var;
 return (double)(size_t)(p);
}

It means the expander creates:

(insn 5 4 6 3 (set (reg:DF 125)
        (unsigned_float:DF (reg/f:DI 115 virtual-stack-vars))) pr41551.c:11 -1
     (nil))

Which then doesn't match when the target is VSX.  There are several different
ways this can be solved:
  1) Allow virtual stack registers to be used in the vsx register operands.
  2) Add a new predicate that doesn't allow virtual stack registers in the
expander;
  3) Add code in the expander to copy the results if it is in a virtual
register.


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

end of thread, other threads:[~2011-02-03  5:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 20:43 [Bug target/47580] New: Powerpc GCC fails test gcc.dg/pr41551.c if built with --with-cpu=power7 meissner at gcc dot gnu.org
2011-02-01 20:46 ` [Bug target/47580] " meissner at gcc dot gnu.org
2011-02-01 20:56 ` meissner at gcc dot gnu.org
2011-02-01 21:07 ` meissner at gcc dot gnu.org
2011-02-02  1:16 ` meissner at gcc dot gnu.org
2011-02-03  0:41 ` meissner at gcc dot gnu.org
2011-02-03  5:51 ` 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).