public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix PR middle-end/53590 again
@ 2014-07-10 10:45 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2014-07-10 10:45 UTC (permalink / raw)
  To: gcc-patches

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

The optimization was almost immediately disabled accidentally by:
  https://gcc.gnu.org/ml/gcc-cvs/2012-06/msg00577.html
Of course I should have added a testcase in the first place...

Tested on x86_64-suse-linux, applied on all active branches as obvious (this 
only affects the Ada compiler).


2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>

	PR middle-end/53590
	* function.c (allocate_struct_function): Revert r188667 change.


2014-07-10  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/opt39.adb: New test.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 482 bytes --]

Index: function.c
===================================================================
--- function.c	(revision 212420)
+++ function.c	(working copy)
@@ -4549,6 +4549,7 @@ allocate_struct_function (tree fndecl, b
       /* ??? This could be set on a per-function basis by the front-end
          but is this worth the hassle?  */
       cfun->can_throw_non_call_exceptions = flag_non_call_exceptions;
+      cfun->can_delete_dead_exceptions = flag_delete_dead_exceptions;
     }
 }
 

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

-- { dg-do compile }
-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" }

procedure Opt39 (I : Integer) is

  type Rec is record
    I1 : Integer;
    I2 : Integer;
    I3 : Integer;
    I4 : Integer;
    I5 : Integer;
  end record;

  procedure Set (A : access Rec; I : Integer) is
    Tmp : Rec := A.all;
  begin
    Tmp.I1 := I;
    A.all := Tmp;
  end;

  R : aliased Rec;

begin
  Set (R'Access, I);
  if R.I1 /= I then
    raise Program_Error;
  end if;
end;

-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } }
-- { dg-final { cleanup-tree-dump "optimized" } }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-10 10:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-10 10:45 Fix PR middle-end/53590 again Eric Botcazou

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).