This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCSE botch with EH case


This is a cut-down version of the ACATS test with the same name:

PROCEDURE C95072A IS
BEGIN
     DECLARE  -- (A)
          I : INTEGER;
          E : EXCEPTION;
          TASK TA IS
               ENTRY EA (EO : OUT INTEGER; EIO : OUT INTEGER);
          END TA;
          TASK BODY TA IS
          BEGIN
               ACCEPT EA (EO : OUT INTEGER; EIO : OUT INTEGER) DO
                    EO := 10;
                    EIO := 100;
                    I := I + 1;
                    RAISE E;            -- CHECK EXCEPTION HANDLING.
               END EA;
          END TA;

     BEGIN  -- (A)
          I := 0;   -- INITIALIZE I SO VARIOUS CASES CAN BE DETECTED.
          TA.EA (I, I);
     EXCEPTION
          WHEN E =>
	     IF I /= 1 THEN
		raise Program_Error;
	     END IF;
     END;  -- (A)
END C95072A;

If I look at .07.gcse, I see:

STORE_MOTION  delete insn in BB 12:
      (insn 109 185 215 12 (set (mem/s/j:SI (plus:DI (reg/f:DI 20 frame)
                            (const_int -32 [0xffffffffffffffe0])) [16 FRAME.59.i+0 S4 A128])
                    (reg:SI 102)) 43 {*movsi_1_nointernunit} (nil)
                (nil))
STORE MOTION  replaced with insn:
      (insn 215 109 111 12 (set (reg:SI 108)
                    (reg:SI 102)) -1 (nil)
                (nil))
STORE_MOTION  insert store at start of BB 14:
(insn 216 209 207 14 (set (mem/s/j:SI (plus:DI (reg/f:DI 20 frame)
                            (const_int -32 [0xffffffffffffffe0])) [16 FRAME.59.i+0 S4 A128])
                    (reg:SI 108)) -1 (nil)
                (nil))

That makes no sense and is the source of the problem.  The issue is that
the edges it's looking at are abnormal edges, so it's creating a store in
the EH case that wasn't there in the the normal case.  I don't at all
understand what this store motion is all about.  Not only does it appear
incorrect, but I don't see how it's an "optimization".

I'm at a complete loss to understand this, which looks like it's causing
the remaining ACATS failures.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]