public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org, Richard Biener <richard.guenther@gmail.com>
Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p
Date: Fri, 16 Oct 2015 15:58:00 -0000	[thread overview]
Message-ID: <3370546.VBkdrdfpOC@polaris> (raw)
In-Reply-To: <20151015232415.GC4230@kam.mff.cuni.cz>

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

> I wasn't aware that x86/IA-64 is still broken.  I am flying to NY tomorrow
> but will try to take a look. The ICEs are not caused by operand_equal_p
> changes, but the change to useless_type_conversion to ignore mode on
> aggregate types.

Sure, but I'd like to avoid hiding new problems against preexisting ICEs.

> A safe way would be to add the mode check back (as was in my original patch)
> that does not change my original intent to separate CANONICAL_TYPE from
> gimple semantic type equivalence machinery. It was however outcome of the
> discussion that we would preffer the mode to be ignored in this case which
> means fixing expansion side.

What do we gain by doing this?  Pretending that the mode doesn't matter is a 
lie at the RTL level and I don't see why GIMPLE would have to care.

> I have no way to reproduce the IA-64 change, but will send proposed patch -
> from backtrace it was clear where the wrong mode went in.  Will wait with
> operand_euqal_p changess until this is fixed.

Thanks.  I have installed 2 testcases that exhibit 2 distinct ICEs on x86-64, 
pack21.adb at -O0 and pack22.adb at -O1 (similar to the IA-64 one).


	PR middle-end/67966
	* gnat.dg/pack21.adb: New test.
	* gnat.dg/pack22.adb: Likewise.
	* gnat.dg/pack22_pkg.ad[sb]: New helper.


-- 
Eric Botcazou

[-- Attachment #2: pack21.adb --]
[-- Type: text/x-adasrc, Size: 526 bytes --]

-- { dg-do compile }
-- { dg-options "-gnatws" }

procedure Pack21 is

  type Enum is (ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX,
                SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE,
                THIRTEEN, FOURTEEN, FIFTEEN);

  type Rec1 is record
    I1 : INTEGER range 0 .. 800;
    I2 : INTEGER range 0 .. 15 := 0;
    E  : Enum;
  end record;
  pragma PACK (Rec1);

  type Rec2 is record
    F : Rec1;
  end record;

  for Rec2 use record
    F at 0 range 2 .. 19;
  end record;

  R1, R2 : Rec2;

begin
  null;
end;

[-- Attachment #3: pack22.adb --]
[-- Type: text/x-adasrc, Size: 371 bytes --]

-- { dg-do compile }
-- { dg-options "-O -gnatws" }

with Pack22_Pkg; use Pack22_Pkg;

procedure Pack22 is

   package Role_Map is new Bit_Map_Generic;

   type Role_List is new Role_Map.List;
   Roles_1 : Role_List;
   Roles_2 : Role_List;
   Roles_3 : Role_List;

begin
   Temp_buffer := (others => 1);
   Temp_Buffer(2) := (0);
   Roles_1 := Roles_2 xor Roles_3;
end;

[-- Attachment #4: pack22_pkg.adb --]
[-- Type: text/x-adasrc, Size: 351 bytes --]

package body Pack22_Pkg is

   package body Bit_Map_Generic is

      function "xor" (L, R : List) return List is
         Temp : List;
         for Temp'address use Temp_buffer'address;
      begin
         Temp.Bits := L.Bits xor R.Bits;
         Temp.Counter.Counter := 0;
         return Temp;
      end;

   end Bit_Map_Generic;

end Pack22_Pkg;

[-- Attachment #5: pack22_pkg.ads --]
[-- Type: text/x-adasrc, Size: 1557 bytes --]

package Pack22_Pkg is

   type byte is mod 256;
   Temp_buffer : array (0..8) of byte:= (others => 0);
   for Temp_buffer'Alignment use 2;

   subtype Id is Short_integer;

   generic
      Dummy : Integer := 0;
   package Bit_Map_Generic is

      type List is private;
      function "xor" (L, R : List) return List;

   private
      type Offset_T is range 0 .. Id'Last;
      type Counter_T is new short_integer;
      for Counter_T'Size use 16;

      type Bit_List is array (Id range <>) of Boolean;
      pragma Pack (Bit_List);

      type List_Counter_T (Is_Defined : Boolean := True) is
         record
            Dummy : Boolean := False;
            case Is_Defined is
               when True =>
                  Counter : Counter_T := 0;
               when False =>
                  null;
            end case;
         end record;
      for List_Counter_T use
         record
            Is_Defined at 0 range 0 .. 7;
            Dummy at 1 range 0 .. 7;
            Counter at 2 range 0 .. 15;
         end record;

      type List is
         record
            Offset : Offset_T := Offset_T (1) - 1;
            Counter : List_Counter_T;
            Bits : Bit_List (1 .. 6);
         end record;
      for List use
         record
            Offset at 0 range 0 .. 15;
            Counter at 2 range 0 .. 31;
         end record;

      type Iterator is
         record
            No_More_Id : Boolean := True;
            Current_Id : Id;
            The_List : List;
         end record;

   end Bit_Map_Generic;

end Pack22_Pkg;

  reply	other threads:[~2015-10-16 15:57 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 16:29 Jan Hubicka
2015-10-15  8:39 ` Richard Biener
2015-10-15 11:22   ` Eric Botcazou
2015-10-15 19:47     ` Eric Botcazou
2015-10-15 23:24       ` Jan Hubicka
2015-10-16 15:58         ` Eric Botcazou [this message]
2015-10-16 21:47           ` Richard Biener
2015-10-17 10:27             ` Eric Botcazou
2015-10-17 15:17               ` Richard Biener
2015-10-17 18:57                 ` Jan Hubicka
2015-10-18 12:57                   ` Eric Botcazou
2015-10-18 16:37                     ` Jan Hubicka
2015-10-18 17:14                       ` Richard Biener
2015-10-18 18:45                         ` Jan Hubicka
2015-10-19 12:31                           ` Richard Biener
2015-10-19 21:01                             ` Jan Hubicka
2015-10-19  8:17                         ` Eric Botcazou
2015-10-19  7:58                       ` Eric Botcazou
2015-10-19 19:46                         ` Jan Hubicka
2015-10-20  7:02                           ` Eric Botcazou
2015-10-21 22:22                             ` Jan Hubicka
2015-10-22  8:52                               ` Andreas Schwab
2015-10-28 22:49                               ` Eric Botcazou
2015-10-29  4:35                                 ` Jan Hubicka
2015-10-29 11:31                                   ` Richard Biener
2015-10-29 11:32                                     ` Richard Biener
2015-10-29 11:32                                       ` Richard Biener
2015-11-04  8:51                                       ` Eric Botcazou
2015-10-29 15:06                                     ` Jan Hubicka
2015-10-29 15:24                                       ` Richard Biener
2015-10-29 15:53                                         ` Jan Hubicka
2015-10-30  8:57                                           ` Richard Biener
2015-10-30 15:28                                             ` Jan Hubicka
2015-11-02  9:55                                               ` Richard Biener
2015-10-30  9:56                                       ` Eric Botcazou
2015-10-30 15:19                                         ` Jan Hubicka
2015-10-31 17:39                                           ` Eric Botcazou
2015-10-31 17:58                                             ` Richard Biener
2015-11-03 10:26                                               ` Eric Botcazou
2015-11-03 11:39                                                 ` Richard Biener
2015-11-02  9:30                                             ` Andreas Schwab
2015-11-03  8:43                                               ` Eric Botcazou
2015-11-04  7:23                                                 ` Jan Hubicka
2015-11-04  8:20                                                   ` Eric Botcazou
2015-11-04 16:50                                                     ` Jan Hubicka
2015-11-05 13:49                                                       ` Richard Biener
2015-10-21  4:42                           ` Jan Hubicka
2015-10-21  8:54                             ` Richard Biener
2015-10-21 11:24                             ` Eric Botcazou
2015-10-23  5:22                             ` Jan Hubicka
2015-10-23  9:14                               ` Richard Biener
2015-10-15 16:59   ` Jan Hubicka

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=3370546.VBkdrdfpOC@polaris \
    --to=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=richard.guenther@gmail.com \
    /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).