From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1217F3857024; Mon, 27 Jul 2020 15:20:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1217F3857024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595863200; bh=skavKuXP+IH1OLdHQ7Iq/C4qZ01yxSpsoIz/MtVhh7o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TqiyPmSQ8vLDp/CRa6gZlWvaZEQEURzYn7NApIVLPXdFzt4XHbnUrtxZfo+f99oTz gi3BCtLmpW9mIMCor+pha+TkqRQjnBHEJeSEGmB1A94J3cOeGqItH+wqwKFg9WKJnJ Z3BOx0obDscQ4bVMNXvRjbevkvSULYnmNyMbsyFU= From: "fazedo at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96336] Multiple multiplications fails to optimize Date: Mon, 27 Jul 2020 15:20:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fazedo at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 15:20:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96336 --- Comment #1 from Fabio Azevedo --- int f(int x) { return x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x; //x**16=20 }=20 int g(int x) { return x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x + x*x; //x**16 + x**2 } Using gcc -O3, the first function simplifies to 4 integer multiplications w= hile the second function requires 13.=