From: Uros Bizjak Date: Thu, 23 May 2019 19:46:56 +0000 (+0200) Subject: re PR target/90552 (attribute((optimize(3))) not overriding -Os) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=103d91c7cb36eaba7728a3550f77dd1f50fdfc29;p=gcc.git re PR target/90552 (attribute((optimize(3))) not overriding -Os) PR target/90552 * config/i386/i386.c (gen_rtx_cost): Use ix86_tune_cost instead of ix86_cost. testsuite/ChangeLog: PR target/90552 * gcc.target/i386/pr90552.c: New test. From-SVN: r271576 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f183fb1427..4956f15102f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-05-23 Uroš Bizjak + + PR target/90552 + * config/i386/i386.c (gen_rtx_cost): + Use ix86_tune_cost instead of ix86_cost. + 2019-05-23 Bill Schmidt Michael Meissner Segher Boessenkool diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 463e78112f0..79fcb5c4e57 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19124,7 +19124,8 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, rtx mask; enum rtx_code code = GET_CODE (x); enum rtx_code outer_code = (enum rtx_code) outer_code_i; - const struct processor_costs *cost = speed ? ix86_cost : &ix86_size_cost; + const struct processor_costs *cost + = speed ? ix86_tune_cost : &ix86_size_cost; int src_cost; switch (code) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f659e459354..e3d9041604e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-23 Uroš Bizjak + + PR target/90552 + * gcc.target/i386/pr90552.c: New test. + 2019-05-23 Mark Eggleston * gfortran.dg/fmt_f_default_field_width_1.f90: Hide REAL(16) behind diff --git a/gcc/testsuite/gcc.target/i386/pr90552.c b/gcc/testsuite/gcc.target/i386/pr90552.c new file mode 100644 index 00000000000..59b7e847700 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr90552.c @@ -0,0 +1,11 @@ +/* PR target/90552 * +/* { dg-do compile } */ +/* { dg-options "-Os" } */ + +__attribute__((optimize(2))) +int foo (int x) +{ + return x / 3; +} + +/* { dg-final { scan-assembler-not "idiv" } } */