public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/46804] New: [4.5/4.6 Regression] gfortran.dg/char_cshift_2.f90 FAILs with -fregmove
Date: Sat, 04 Dec 2010 19:49:00 -0000	[thread overview]
Message-ID: <bug-46804-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: [4.5/4.6 Regression] gfortran.dg/char_cshift_2.f90
                    FAILs with -fregmove
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 22632
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22632
auto-reduced testcase

Output:
$ /mnt/svn/gcc-trunk/binary-167453-lto-fortran-checking-yes-rtl-df/bin/gfortran
-O -fPIC -fexpensive-optimizations -fgcse -foptimize-register-move -fpeel-loops
-fno-tree-loop-optimize pr46804.f90
$ ./a.out 
Aborted

In the assembly, the problem is apparent (intel syntax):
...
    mov    r12d, DWORD PTR A.4.1573[rip+3]    # tmp310, A.4
    mov    DWORD PTR 16[rsp+r8*4], r12d    # shift3, tmp310
...
32bit (unaligned) value is loaded instead of sign-extend byte as is done
without -fregmove:
...
    movsx    r11d, BYTE PTR A.4.1573[rip+3]    # tmp310, A.4
    mov    DWORD PTR 16[rsp+r8*4], r11d    # shift3, tmp310
...

so shift3 contains invalid data

The problem seems to first appear in the 182r.regmove dump:
$ diff pr46804.f90.180r.ce2 pr46804.f90.182r.regmove
...
2009,2010c1409,1410
<         (sign_extend:SI (reg:QI 236))) pr46804.f90:17 132 {extendqisi2}
<      (expr_list:REG_DEAD (reg:QI 236)
---
>         (reg:SI 236)) pr46804.f90:17 64 {*movsi_internal}
>      (expr_list:REG_DEAD (reg:SI 236)
...

Output:
r167453 - fail
r158095 - fail
4.5 r166509 - fail
4.4 r166509 - OK


             reply	other threads:[~2010-12-04 19:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04 19:49 zsojka at seznam dot cz [this message]
2010-12-06 14:56 ` [Bug rtl-optimization/46804] " zsojka at seznam dot cz
2010-12-06 16:39 ` hjl.tools at gmail dot com
2010-12-08 10:50 ` jakub at gcc dot gnu.org
2010-12-08 11:17 ` jakub at gcc dot gnu.org
2010-12-08 11:54 ` jakub at gcc dot gnu.org
2010-12-10 16:41 ` jakub at gcc dot gnu.org
2010-12-10 16:47 ` [Bug rtl-optimization/46804] [4.5 " jakub at gcc dot gnu.org
2010-12-16 13:11 ` rguenth at gcc dot gnu.org
2011-01-16 20:20 ` jakub at gcc dot gnu.org
2011-01-17  8:28 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-46804-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).