public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures
@ 2012-08-01 16:19 hjl.tools at gmail dot com
  2012-08-01 16:25 ` [Bug rtl-optimization/54157] " hjl.tools at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-01 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54157
           Summary: [x32] -maddress-mode=long failures
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: ubizjak@gmail.com
            Target: x86_64-linux


[hjl@gnu-32 gcc]$ /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
 -fno-diagnostics-show-caret   -msse2 -ftree-vectorize -fno-vect-cost-model
-fno-common -O2 -fdump-tree-vect-details -fno-section-anchors  -lm   -mx32 -o
./no-section-anchors-vect-69.exe  -maddress-mode=short
[hjl@gnu-32 gcc]$ /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
 -fno-diagnostics-show-caret   -msse2 -ftree-vectorize -fno-vect-cost-model
-fno-common -O2 -fdump-tree-vect-details -fno-section-anchors  -lm   -mx32 -o
./no-section-anchors-vect-69.exe  -maddress-mode=long
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c:
In function ‘main1’:
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c:106:1:
internal compiler error: in plus_constant, at explow.c:88
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-32 gcc]$ 

[hjl@gnu-32 gfortran]$
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/testsuite/gfortran/../../gfortran
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/testsuite/gfortran/../../
-B/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-unknown-linux-gnu/x32/libgfortran/
/export/gnu/import/git/gcc/gcc/testsuite/gfortran.dg/vect/pr32380.f 
-fno-diagnostics-show-caret   -O  -O2 -ftree-vectorize -fno-vect-cost-model
-ftree-vectorizer-verbose=4 -fdump-tree-vect-stats -msse2 -O3 -fcray-pointer -S
 -mx32 -o pr32380.s   -maddress-mode=short
[hjl@gnu-32 gfortran]$
/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/testsuite/gfortran/../../gfortran
-B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/testsuite/gfortran/../../
-B/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-unknown-linux-gnu/x32/libgfortran/
/export/gnu/import/git/gcc/gcc/testsuite/gfortran.dg/vect/pr32380.f 
-fno-diagnostics-show-caret   -O  -O2 -ftree-vectorize -fno-vect-cost-model
-ftree-vectorizer-verbose=4 -fdump-tree-vect-stats -msse2 -O3 -fcray-pointer -S
 -mx32 -o pr32380.s   -maddress-mode=long
/export/gnu/import/git/gcc/gcc/testsuite/gfortran.dg/vect/pr32380.f: In
function ‘trnfbt’:
/export/gnu/import/git/gcc/gcc/testsuite/gfortran.dg/vect/pr32380.f:260:0:
internal compiler error: in plus_constant, at explow.c:88
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-32 gfortran]$


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
@ 2012-08-01 16:25 ` hjl.tools at gmail dot com
  2012-08-01 16:50 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-01 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-01 16:25:15 UTC ---
[hjl@gnu-32 gcc]$ cat /tmp/x.i
struct s2{
  int n[24 -1][24 -1][24 -1];
};

struct test2{
  struct s2 e;
};

struct test2 tmp2[4];

void main1 ()
{
  int i,j;

  for (i = 0; i < 24 -4; i++)
      for (j = 0; j < 24 -4; j++)
          tmp2[2].e.n[1][i][j] = 8;
}
[hjl@gnu-32 gcc]$ ./xgcc -B./ -O2 -mx32 -maddress-mode=long -S /tmp/x.i
-ftree-vectorize
/tmp/x.i: In function ‘main1’:
/tmp/x.i:18:1: internal compiler error: in plus_constant, at explow.c:88
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-32 gcc]$


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
  2012-08-01 16:25 ` [Bug rtl-optimization/54157] " hjl.tools at gmail dot com
@ 2012-08-01 16:50 ` hjl.tools at gmail dot com
  2012-08-01 21:48 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-01 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-01 16:49:53 UTC ---
Created attachment 27925
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27925
A patch


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
  2012-08-01 16:25 ` [Bug rtl-optimization/54157] " hjl.tools at gmail dot com
  2012-08-01 16:50 ` hjl.tools at gmail dot com
@ 2012-08-01 21:48 ` hjl.tools at gmail dot com
  2012-08-01 22:12 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-01 21:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-01 21:47:59 UTC ---
make_extraction in combine generates:

7474          inner = force_to_mode (inner, wanted_inner_mode,
7475                                 pos_rtx
7476                                 || len + orig_pos >=
HOST_BITS_PER_WIDE_INT
7477                                 ? ~(unsigned HOST_WIDE_INT) 0
7478                                 : ((((unsigned HOST_WIDE_INT) 1 << len) -
1)
(gdb) call debug_rtx (inner)
(plus:SI (reg:SI 109 [ D.1765 ])
    (const:SI (plus:SI (symbol_ref:SI ("tmp2") <var_decl 0x7ffff0f06140 tmp2>)
            (const_int 99452 [0x1847c]))))
(gdb) p wanted_inner_mode
$2 = DImode
(gdb)

When combines see

(and:SI (lshiftrt:SI (plus:SI (reg:SI 109 [ D.1765 ])
            (const:SI (plus:SI (symbol_ref:SI ("tmp2") <var_decl 0x7ffff0f06140
tmp2>)
                    (const_int 99452 [0x1847c]))))
        (const_int 2 [0x2]))
    (const_int 3 [0x3]))
(gdb) 

it calls make_extraction:

  if (! in_dest && unsignedp
      && mode_for_extraction (EP_extzv, -1) != MAX_MACHINE_MODE)
    {
      wanted_inner_reg_mode = mode_for_extraction (EP_extzv, 1);
      pos_mode = mode_for_extraction (EP_extzv, 3);
      extraction_mode = mode_for_extraction (EP_extzv, 0);
    }

mode_for_extraction:

  /* Everyone who uses this function used to follow it with
     if (result == VOIDmode) result = word_mode; */
  if (data->operand[opno].mode == VOIDmode)
    return word_mode;

and i386.md:

(define_expand "extzv"
  [(set (match_operand:SI 0 "register_operand")
        (zero_extract:SI (match_operand 1 "ext_register_operand")
                         (match_operand:SI 2 "const8_operand")
                         (match_operand:SI 3 "const8_operand")))]
  ""


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2012-08-01 21:48 ` hjl.tools at gmail dot com
@ 2012-08-01 22:12 ` hjl.tools at gmail dot com
  2012-08-08 13:40 ` hjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-01 22:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-01 22:12:00 UTC ---
This patch:

diff --git a/gcc/expmed.c b/gcc/expmed.c
index 1fe0034..2780164 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -380,7 +380,7 @@ mode_for_extraction (enum extraction_pattern pattern, int
opno)
   /* Everyone who uses this function used to follow it with
      if (result == VOIDmode) result = word_mode; */
   if (data->operand[opno].mode == VOIDmode)
-    return word_mode;
+    return ptr_mode;
   return data->operand[opno].mode;
 }


also works on the testcase.


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2012-08-01 22:12 ` hjl.tools at gmail dot com
@ 2012-08-08 13:40 ` hjl at gcc dot gnu.org
  2012-08-08 13:42 ` hjl.tools at gmail dot com
  2012-08-09 15:34 ` hjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hjl at gcc dot gnu.org @ 2012-08-08 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2012-08-08 13:39:41 UTC ---
Author: hjl
Date: Wed Aug  8 13:39:33 2012
New Revision: 190228

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190228
Log:
Don't return identity for CONST or symbolic reference

gcc/

    PR rtl-optimization/54157
    * combine.c (gen_lowpart_for_combine): Don't return identity
    for CONST or symbolic reference.

gcc/testsuite/

    PR rtl-optimization/54157
    * gcc.target/i386/pr54157.c: New file.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr54157.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2012-08-08 13:40 ` hjl at gcc dot gnu.org
@ 2012-08-08 13:42 ` hjl.tools at gmail dot com
  2012-08-09 15:34 ` hjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-08 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-08 13:42:17 UTC ---
Fixed.


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

* [Bug rtl-optimization/54157] [x32] -maddress-mode=long failures
  2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2012-08-08 13:42 ` hjl.tools at gmail dot com
@ 2012-08-09 15:34 ` hjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hjl at gcc dot gnu.org @ 2012-08-09 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> 2012-08-09 15:33:36 UTC ---
Author: hjl
Date: Thu Aug  9 15:33:28 2012
New Revision: 190256

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190256
Log:
Don't return identity for CONST or symbolic reference

gcc/

2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>

    Backport from mainline
    2012-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
            H.J. Lu  <hongjiu.lu@intel.com>

    PR rtl-optimization/54157
    * combine.c (gen_lowpart_for_combine): Don't return identity
    for CONST or symbolic reference.

gcc/testsuite/

2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>

    Backport from mainline
    2012-08-08  H.J. Lu  <hongjiu.lu@intel.com>

    PR rtl-optimization/54157
    * gcc.target/i386/pr54157.c: New file.


Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.target/i386/pr54157.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/combine.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2012-08-09 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 16:19 [Bug rtl-optimization/54157] New: [x32] -maddress-mode=long failures hjl.tools at gmail dot com
2012-08-01 16:25 ` [Bug rtl-optimization/54157] " hjl.tools at gmail dot com
2012-08-01 16:50 ` hjl.tools at gmail dot com
2012-08-01 21:48 ` hjl.tools at gmail dot com
2012-08-01 22:12 ` hjl.tools at gmail dot com
2012-08-08 13:40 ` hjl at gcc dot gnu.org
2012-08-08 13:42 ` hjl.tools at gmail dot com
2012-08-09 15:34 ` hjl 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).