{"id":812854,"url":"http://patchwork.ozlabs.org/api/patches/812854/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/alpine.LSU.2.20.1709121546240.26836@zhemvz.fhfr.qr/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<alpine.LSU.2.20.1709121546240.26836@zhemvz.fhfr.qr>","list_archive_url":null,"date":"2017-09-12T13:47:36","name":"Fix PR82157","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f670aea825c12b3cf62840206813a848c888bb8d","submitter":{"id":4338,"url":"http://patchwork.ozlabs.org/api/people/4338/?format=json","name":"Richard Biener","email":"rguenther@suse.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/alpine.LSU.2.20.1709121546240.26836@zhemvz.fhfr.qr/mbox/","series":[{"id":2706,"url":"http://patchwork.ozlabs.org/api/series/2706/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=2706","date":"2017-09-12T13:47:36","name":"Fix PR82157","version":1,"mbox":"http://patchwork.ozlabs.org/series/2706/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812854/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812854/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-return-461921-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461921-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"MUo2VKy+\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs5hf4ZrVz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 23:47:46 +1000 (AEST)","(qmail 33501 invoked by alias); 12 Sep 2017 13:47:40 -0000","(qmail 33483 invoked by uid 89); 12 Sep 2017 13:47:39 -0000","from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 12 Sep 2017 13:47:38 +0000","from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\tby\n\tmx1.suse.de (Postfix) with ESMTP id 333E8AB43\tfor\n\t<gcc-patches@gcc.gnu.org>; Tue, 12 Sep 2017 13:47:36 +0000 (UTC)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:subject:message-id:mime-version:content-type; q=dns; s=\n\tdefault; b=qXhGaNnaNC+CzMNjMm63jBfGai8gXfKvuB96BpOKK3jWVgHWz+e9B\n\tl2ZwePWOFqI3U+cM0h6DDciITULbWAtydaAwDGE4k2XOWCO47jo/jp/KFsQZ7Ujl\n\tIFnTkx1WUHNK9zEfI7mnwzlRYiRorsnX+yMwCf1sdDwMMFp61ZpzoA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:subject:message-id:mime-version:content-type; s=\n\tdefault; bh=i49v8CpI4FWXVvjsXGYtc693m0k=; b=MUo2VKy+IPWpE1o0x9Bp\n\trBLbAGd8fBgt7cWKSAKIWznB5Qiaxy+xQ1DmxeGSwTeGHY3FDBLb9DLDU6jKxU0V\n\tKn/YcE/OM7igX7JXAmVu2zNHOEPFuTbz0Wgt6eBAKolbHVBflQQRCeAQDcQtLVz4\n\tQ9VwnlhtII/p0EuWhHtqF3c=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2,\n\tGIT_PATCH_3, KAM_ASCII_DIVIDERS, RP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1557","X-HELO":"mx1.suse.de","Date":"Tue, 12 Sep 2017 15:47:36 +0200 (CEST)","From":"Richard Biener <rguenther@suse.de>","To":"gcc-patches@gcc.gnu.org","Subject":"[PATCH] Fix PR82157","Message-ID":"<alpine.LSU.2.20.1709121546240.26836@zhemvz.fhfr.qr>","User-Agent":"Alpine 2.20 (LSU 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII"},"content":"The following fixes a latent issue in fold_stmt uncovered by\nPRE re-org.  We muck with the gsi in inapprorpate ways.\n\nBootstrapped on x86_64-unknown-linux-gnu, testing in progress.\n\nRichard.\n\n2017-09-12  Richard Biener  <rguenther@suse.de>\n\n\tPR tree-optimization/82157\n\t* tree-ssa-pre.c (remove_dead_inserted_code): Do not remove\n\tstmts with side-effects.\n\n\t* gcc.dg/torture/pr82157.c: New testcase.","diff":"Index: gcc/tree-ssa-pre.c\n===================================================================\n--- gcc/tree-ssa-pre.c\t(revision 252002)\n+++ gcc/tree-ssa-pre.c\t(working copy)\n@@ -4913,6 +4964,8 @@ remove_dead_inserted_code (void)\n \tcontinue;\n \n       gimple *t = SSA_NAME_DEF_STMT (def);\n+      if (gimple_has_side_effects (t))\n+\tcontinue;\n \n       /* Add uses to the worklist.  */\n       ssa_op_iter iter;\nIndex: gcc/testsuite/gcc.dg/torture/pr82157.c\n===================================================================\n--- gcc/testsuite/gcc.dg/torture/pr82157.c\t(nonexistent)\n+++ gcc/testsuite/gcc.dg/torture/pr82157.c\t(working copy)\n@@ -0,0 +1,43 @@\n+/* { dg-do compile } */\n+\n+int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;\n+\n+int aa ()\n+{ \n+  w = f < 0 || e >> f;\n+  while (z)\n+    h = i && (r && p) | ((l = p) == c % d);\n+  k = v + 1 < a;\n+  t = -(j < 1) * q;\n+  return u;\n+}\n+\n+int ab ()\n+{ \n+  for (j = 0; 1; j = 5)\n+    if (!s)\n+      return d;\n+}\n+\n+void ac ()\n+{ \n+  char ad = aa ();\n+  ab ();\n+  if (x)\n+    { \n+      for (m = 0; m < 3; m = a)\n+\t{ \n+\t  y = a && b;\n+\t  if (g)\n+\t    break;\n+\t}\n+      n = j;\n+    }\n+  o = j & ad;\n+}\n+\n+int main ()\n+{ \n+  ac ();\n+  return 0;\n+}\n","prefixes":[]}