[Bug tree-optimization/83501] [8 Regression] strlen(a) not folded after strcpy(a, "...")

2017-12-19 Thread prathamesh3492 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83501

prathamesh3492 at gcc dot gnu.org changed:

   What|Removed |Added

 CC||prathamesh3492 at gcc dot 
gnu.org

--- Comment #2 from prathamesh3492 at gcc dot gnu.org ---
Created attachment 42927
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42927=edit
Untested fix

[Bug target/83387] PowerPC64: Infinite loops in do_reload() with -msoft-float

2017-12-19 Thread sebastian.hu...@embedded-brains.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83387

--- Comment #14 from Sebastian Huber  ---
(In reply to Peter Bergner from comment #13)
> (In reply to Sebastian Huber from comment #12)
> > (In reply to Peter Bergner from comment #9)
> > [...]
> > > Here, you can see that on ELFv2, we always assume HW FP regs are 
> > > avialable,
> > > because we're forcing usage of HW FP registers (FP_ARG_RETURN, ie, f1, aka
> > > reg 33).  I'm afraid that are going to be a *LOT* of these assumptions
> > > builtin into the backend and tracking them all down and fixing them is not
> > > going to be easy.  That's why I asked earlier, if you really really need 
> > > to
> > > disable HW FP for your builds.  If you do, then good luck to you finding
> > > them all.
> > 
> > Thanks for your investigations. I removed the 64-bit soft-float multilib.
> 
> I can't promise this is all you need, but does the following patch help?
> 
> Index: gcc/config/rs6000/rs6000.c
> ===
> --- gcc/config/rs6000/rs6000.c(revision 255700)
> +++ gcc/config/rs6000/rs6000.c(working copy)
> @@ -11095,7 +11095,8 @@ rs6000_discover_homogeneous_aggregate (m
>   homogeneous aggregates; these types are handled via the
>   targetm.calls.split_complex_arg mechanism.  Complex types
>   can be elements of homogeneous aggregates, however.  */
> -  if (DEFAULT_ABI == ABI_ELFv2 && type && AGGREGATE_TYPE_P (type))
> +  if (TARGET_HARD_FLOAT && DEFAULT_ABI == ABI_ELFv2 && type
> +  && AGGREGATE_TYPE_P (type))
>  {
>machine_mode field_mode = VOIDmode;
>int field_count = rs6000_aggregate_candidate (type, _mode);
> 
> 
> 

With this patch I can build an Ada compiler with a -m64 and -msoft-float
multilib.

[Bug target/83499] [8 Regression] bootstrap fails in stage3 on arm-linux-gnueabihf (as: unaligned opcodes detected in executable segment)

2017-12-19 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83499

--- Comment #3 from Matthias Klose  ---
Created attachment 42926
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42926=edit
assembler file

[Bug target/83499] [8 Regression] bootstrap fails in stage3 on arm-linux-gnueabihf (as: unaligned opcodes detected in executable segment)

2017-12-19 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83499

--- Comment #2 from Matthias Klose  ---
Created attachment 42925
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42925=edit
preprocessed source

[Bug rtl-optimization/81791] [8 Regression] ICE in cfg_layout_redirect_edge_and_branch, at cfgrtl.c:4422

2017-12-19 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81791

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #3 from Arseny Solokha  ---
int sa, wy;

void
v0 (int *yg, int dq)
{
  int mc = 0;

  while (dq < 1)
{
  while (dq < 0)
{
}

  while (wy != 0)
{
 x6:
  *yg = mc;
  for (sa = 0; sa < 2; ++sa)
wy = 1;
  if (dq != 0)
*yg = 0;
  ++mc;
}
}

  goto x6;
}

% gcc-8.0.0-alpha20171217 -O2 -fmodulo-sched -fno-guess-branch-probability
-fno-tree-scev-cprop -c euvaex6b.c 
during RTL pass: sms
euvaex6b.c: In function 'v0':
euvaex6b.c:27:1: internal compiler error: in
cfg_layout_redirect_edge_and_branch, at cfgrtl.c:4434
 }
 ^
0x5c8985 cfg_layout_redirect_edge_and_branch
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfgrtl.c:4434
0x97d1b8 cfg_layout_redirect_edge_and_branch_force
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfgrtl.c:
0x9664d3 redirect_edge_and_branch_force(edge_def*, basic_block_def*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfghooks.c:486
0x966ee6 make_forwarder_block(basic_block_def*, bool (*)(edge_def*), void
(*)(basic_block_def*))
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfghooks.c:893
0x978a53 create_preheader(loop*, int)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfgloopmanip.c:1501
0x978c07 create_preheaders(int)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/cfgloopmanip.c:1552
0xbd4229 apply_loop_flags
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/loop-init.c:64
0xbd4aec loop_optimizer_init(unsigned int)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/loop-init.c:123
0x1492609 sms_schedule
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/modulo-sched.c:1351
0x1494dbf execute
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20171217/work/gcc-8-20171217/gcc/modulo-sched.c:3342

(as of r255766)

I believe it's the same issue.

[Bug rtl-optimization/83475] [8 Regression] ICE: verify_flow_info failed (error: non-cold basic block 3 reachable only by paths crossing the cold partition)

2017-12-19 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83475

--- Comment #1 from Arseny Solokha  ---
The testcase in PR81791 comment 3 can be easily modified to trigger the ICE
reported here, so I believe this PR is a duplicate of PR81791.

[Bug gcov-profile/83505] [GCOV] a pointer assignment before label lead to incorrect coverage in gcov

2017-12-19 Thread yangyibiao at nju dot edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83505

--- Comment #1 from Yibiao Yang  ---
Following is the reduced code for reproducing this issue:

$ cat small.cint main()
{
int t = 1;
int *p = 
if (1) {
if (0)
return 0;
return 1;
}
}

$ gcc small.c -fprofile-rcs -ftest-coverage; ./a.out; gcov small.c; cat
small.c.gcov
File 'small.c'
Lines executed:100.00% of 5
Creating 'small.c.gcov'

-:0:Source:small.c
-:0:Graph:small.gcno
-:0:Data:small.gcda
-:0:Runs:1
-:0:Programs:1
1:1:int main()
-:2:{
1:3:int t = 1;
1:4:int *p = 
-:5:if (1) {
-:6:if (0)
1:7:return 0;
1:8:return 1;
-:9:}
-:   10:}

[Bug gcov-profile/83505] New: [GCOV] a pointer assignment before label lead to incorrect coverage in gcov

2017-12-19 Thread yangyibiao at nju dot edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83505

Bug ID: 83505
   Summary: [GCOV] a pointer assignment before label lead to
incorrect coverage in gcov
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yangyibiao at nju dot edu.cn
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3'
--with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3)

$ cat small.c
int main()
{
int t = 1;
int *p = 
lbl:
if (t > 0) {
if (0)
return 0;
if (0)
goto lbl;
return 1;
}
}

$ gcc small.c -fprofile-arcs -ftest-coverage; ./a.out; gcov small.c; cat
small.c.gcov
File 'small.c'
Lines executed:100.00% of 7
Creating 'small.c.gcov'

-:0:Source:small.c
-:0:Graph:small.gcno
-:0:Data:small.gcda
-:0:Runs:1
-:0:Programs:1
1:1:int main()
-:2:{
1:3:int t = 1;
1:4:int *p = 
1:5:lbl:
1:6:if (t > 0) {
-:7:if (0)
1:8:return 0;
-:9:if (0)
-:   10:goto lbl;
1:   11:return 1;
-:   12:}
-:   13:}

Line #8 is wrongly marked as executed. It is obvious that it is not executed
since it is in the if false statement. 

While removing Line #4, the result is correct.

[Bug c++/83484] constexpr not evaluated at compile time

2017-12-19 Thread klaus.doldinger64 at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83484

klaus.doldinger64 at googlemail dot com changed:

   What|Removed |Added

 CC||klaus.doldinger64@googlemai
   ||l.com

--- Comment #3 from klaus.doldinger64 at googlemail dot com ---
Here ist a simplified version of a MCVE:

template
struct X {
static constexpr int x = 0;
static constexpr int y = 1;
};

template<>
constexpr int X<1>::x = 2; // should be ok, but gives duplicate initialization
error
template<>
constexpr int X<1>::y; // should be ill-formed (constexpr must be initialized),
but gives undefined reference

int main() {   
return X<1>::x + X<1>::y;
}

[Bug c++/83504] New: incorrect attribute const interpretation on function overloads

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83504

Bug ID: 83504
   Summary: incorrect attribute const interpretation on function
overloads
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

When another overload of a function is subsequently declared const, all
versions of GCC treat calls to a prior overload of the same function as const
and eliminate multiple calls to it with the same argument, even if reads global
memory.  As a result, GCC emits the wrong code for uses of such a function as
in the test case below.

$ cat u.C && gcc -O2 -S -Wall -Wextra -fdump-tree-optimized=/dev/stdout u.C
int i;

int f (int) { return i; }
int __attribute__ ((const)) f ();

void g (void)
{
  i = 0;
  int j = f (0);
  i = 1;

  if (j == f (0))
__builtin_abort ();
}

;; Function f (_Z1fi, funcdef_no=0, decl_uid=2326, cgraph_uid=0,
symbol_order=1)

f (int D.2325)
{
  int _2;

   [local count: 1073741825]:
  _2 = i;
  return _2;

}



;; Function g (_Z1gv, funcdef_no=1, decl_uid=2329, cgraph_uid=1,
symbol_order=2)

g ()
{
   [local count: 1073741825]:
  i = 1;
  return;

}

[Bug c++/83503] New: [8 Regression] bogus -Wattributes for const and pure on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83503

Bug ID: 83503
   Summary: [8 Regression] bogus -Wattributes for const and pure
on function template specialization
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Starting with version 8.0 (r255469) GCC issues the following spurious warning
for the definition of the function template specialization of f even
though it's distinct from the primary template.  GCC 7 and prior issued only
the -Wunused-value warning.

I wonder if the underlying problem is the same as in bug 83502.

$ cat u.C && gcc -S -Wall u.C
template 
int __attribute__ ((pure)) f (T) { return 0; }

template <>
int __attribute__ ((const)) f (int) { return 1; }

void fi () { f (0); }

u.C:5:40: warning: ignoring attribute ‘const’ because it conflicts with
attribute ‘pure’ [-Wattributes]
 int __attribute__ ((const)) f (int) { return 1; }
^
u.C: In function ‘void fi()’:
u.C:7:16: warning: statement has no effect [-Wunused-value]
 void fi () { f (0); }
  ~~^~~

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

--- Comment #2 from Martin Sebor  ---
Here's another test case with the same root cause (r190664):

$ cat u.C && gcc -S -Wall u.C
template 
int __attribute__ ((warn_unused_result)) f (T) { return 0; }

template <>
int f (int) { return 1; }

void fi () { f (0); }

u.C: In function ‘void fi()’:
u.C:7:16: warning: ignoring return value of ‘int f(T) [with T = int]’, declared
with attribute warn_unused_result [-Wunused-result]
 void fi () { f (0); }
  ~~^~~

[Bug c++/83498] bogus -Wattributes for always_inline and noinline on distinct overloads

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83498

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
  Known to fail||4.1.0, 4.5.4, 4.8.3, 4.9.3,
   ||5.3.0, 6.2.0, 7.1.0, 8.0

--- Comment #1 from Martin Sebor  ---
Unlike bug 83502 this doesn't appear to be a regression (versions as old as 4.1
issue a bogus warning on the test case).

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=51213

--- Comment #1 from Martin Sebor  ---
Introduced in 4.8 by r190664:

PR c++/51213 (again)
* pt.c (deduction_tsubst_fntype): Remove.
(fn_type_unification): Check deduction depth and call
instantiate_template here.  Handle default argument access checks.
(determine_specialization): Suppress access control.
(tsubst_decl): Check for excessive deduction depth.
(recheck_decl_substitution): Make sure access control is on.
(type_unification_real): Don't mess with access deferring here.
(get_bindings): Adjust for fn_type_unification return type.
* call.c (enum rejection_reason_code): Drop rr_template_instantiation.
(template_instantiation_rejection): Remove.
(struct rejection_reason): Change targs to num_targs.
(template_unification_rejection, print_z_candidate): Adjust.
(add_template_candidate_real): Adjust for fn_type_unification change.
* class.c (resolve_address_of_overloaded_function): Likewise.
* cp-tree.h: Adjust declaration.

[Bug c++/83502] New: [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Bug ID: 83502
   Summary: [6/7/8 Regression] bogus -Wattributes for
always_inline and noinline on function template
specialization
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Similar to bug 83498, GCC issues a bogus -Wattributes on an explicit
specialization a function template that uses attribute always_inline and where
the primary template is declared noinline.

$ cat u.C && gcc -S -Wall -Wextra u.C
template 
void __attribute__ ((noinline)) f (T) { }

template <>
inline void __attribute__ ((always_inline)) f (int) { }

void fi () { f (0); }
void fs () { f (""); }

u.C:5:56: warning: inline declaration of ‘void f(T) [with T = int]’ follows
declaration with attribute ‘noinline’ [-Wattributes]
 inline void __attribute__ ((always_inline)) f (int) { }
^
u.C:2:33: note: previous declaration of ‘void f(T) [with T = int]’ was here
 void __attribute__ ((noinline)) f (T) { }
 ^
u.C:5:56: warning: ‘always_inline’ attribute ignored due to conflict with
‘noinline’ attribute [-Wattributes]
 inline void __attribute__ ((always_inline)) f (int) { }
^

[Bug rtl-optimization/83398] [8 Regression] ICE: in try_ready, at haifa-sched.c:7524 with -O2 -fsched2-use-superblocks -g

2017-12-19 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83398

--- Comment #5 from Arseny Solokha  ---
Testcase in comment 4 seems to be fixed by r255833.

[Bug rtl-optimization/82982] [8 Regression] ICE: qsort checking failed (error: qsort comparator non-negative on sorted output: 5) in ready_sort_real in haifa scheduler

2017-12-19 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82982

--- Comment #2 from Arseny Solokha  ---
With gcc-8.0.0-alpha20171217 snapshot it still reproduces for
powerpc-e500v2-linux-gnuspe, but not for powerpc-e300c3-linux-gnu.

Can it be a duplicate of PR83459?

[Bug tree-optimization/83501] [8 Regression] strlen(a) not folded after strcpy(a, "...")

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83501

Martin Sebor  changed:

   What|Removed |Added

   Keywords||missed-optimization
  Known to work||5.4.0, 6.4.0, 7.2.0
  Known to fail||8.0

--- Comment #1 from Martin Sebor  ---
Bisection points to r255197:

2017-11-28  Richard Biener  

PR middle-end/83141
* gimple-fold.c (gimple_fold_builtin_memory_op): For aggregate
copies generated from memcpy use a character array as reference
type.

[Bug tree-optimization/83501] New: [8 Regression] strlen(a) not folded after strcpy(a, "...")

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83501

Bug ID: 83501
   Summary: [8 Regression] strlen(a) not folded after strcpy(a,
"...")
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

GCC 7 and prior folded into a constant the strlen call in the following simple
test case but GCC 8 no longer does.

$ cat z.c && gcc -O2 -S -Wall -fdump-tree-optimized=/dev/stdout z.c
extern char* stpcpy (char*, const char*);
extern char* strcpy (char*, const char*);

char a[4];

void f (void)
{
  strcpy (a, "abc");

  if (__builtin_strlen (a) != 3)
__builtin_abort ();
}

;; Function f (f, funcdef_no=0, decl_uid=1899, cgraph_uid=0, symbol_order=1)

f ()
{
  long unsigned int _1;

   [local count: 1073741825]:
  MEM[(char * {ref-all})] = MEM[(char * {ref-all})"abc"];
  _1 = __builtin_strlen ();
  if (_1 != 3)
goto ; [0.00%]
  else
goto ; [99.96%]

   [count: 0]:
  __builtin_abort ();

   [local count: 1073312327]:
  return;

}

[Bug middle-end/83423] default_static_chain is sorry for non-nested functions

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83423

Tom de Vries  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Tom de Vries  ---
Patch committed, marking resolved-fixed.

[Bug middle-end/83423] default_static_chain is sorry for non-nested functions

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83423

--- Comment #6 from Tom de Vries  ---
Author: vries
Date: Wed Dec 20 00:46:38 2017
New Revision: 255849

URL: https://gcc.gnu.org/viewcvs?rev=255849=gcc=rev
Log:
Don't call targetm.calls.static_chain in non-static function

2017-12-20  Tom de Vries  

PR middle-end/83423
* config/i386/i386.c (ix86_static_chain): Move DECL_STATIC_CHAIN test
...
* calls.c (rtx_for_static_chain): ... here.  New function.
* calls.h (rtx_for_static_chain): Declare.
* builtins.c (expand_builtin_setjmp_receiver): Use rtx_for_static_chain
instead of targetm.calls.static_chain.
* df-scan.c (df_get_entry_block_def_set): Same.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/calls.c
trunk/gcc/calls.h
trunk/gcc/config/i386/i386.c
trunk/gcc/df-scan.c

[Bug other/83497] CPU2000 172.mgrid starts failing with r254730

2017-12-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83497

--- Comment #1 from Andrew Pinski  ---
I really doubt inlining is causing the miscompiling, only exposing it ...
And if I look at the difference, it looks more like a precision issue which
-ffast-math exposes.

[Bug rtl-optimization/83500] New: gcc.dg/tree-prof/switch-case-1.c fails on aarch64

2017-12-19 Thread sje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83500

Bug ID: 83500
   Summary: gcc.dg/tree-prof/switch-case-1.c fails on aarch64
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sje at gcc dot gnu.org
  Target Milestone: ---

This test started failing on aarch64-linux-gnu with this checkin:

commit b33f4eb038b5c30bf57de6bb10f40e11481c6be6
Author: hubicka 
Date:   Sat Oct 7 16:33:26 2017 +

* tree-switch-conversion.c (do_jump_if_equal, emit_cmp_and_jump_insns):
Update profile.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253512
138bc75d-0d04-0410-96
1f-82ee72b054a4


Before the change I see these lines in the expand file:

% grep 'basic block.* count 4000' *expand 
;; basic block 17, loop depth 0, count 4000, freq 4000, maybe hot
;; basic block 18, loop depth 0, count 4000, freq 4000, maybe hot
% grep 'basic block.* count 2000' *expand 
;; basic block 23, loop depth 0, count 2000, freq 2000, maybe hot


After the change I see these lines in the expand file:

% grep 'basic block.* count 4000' *expand 
;; basic block 17, loop depth 0, count 4000, freq 4000, maybe hot
;; basic block 18, loop depth 0, count 4000, freq 4000, maybe hot
% grep 'basic block.* count 2000' *expand 
;; basic block 8, loop depth 0, count 2000 (adjusted), freq 2000, maybe hot
;; basic block 23, loop depth 0, count 2000, freq 2000, maybe hot

Having two lines with 'count 2000' is causing the test failure, I do
not know if the test needs to be changed or if this is indicating an
actual problem in the compiler.

[Bug testsuite/83483] [8 Regression] gcc.dg/memcpy-6.c FAILs

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83483

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #5 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01324.html

[Bug testsuite/83483] [8 Regression] gcc.dg/memcpy-6.c FAILs

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83483

Martin Sebor  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org

--- Comment #4 from Martin Sebor  ---
I can reproduce the failure with a sparc-sun-solaris2.11 cross-compiler.

The test is my mistake.  I shouldn't have checked it in as it's not finished. 
I created it after a discussion with Richard to verify that GCC would fold
calls to memcpy and memove with small sizes.  Verifying this seemed important
because the change that Richard and I were discussing avoided the folding when
the accesses overlapped, yet nothing in the test suite pointed it out.

That GCC doesn't always fold these calls is apparent not just from this failure
but also from the code in gimple-fold.c which uses MOVE_MAX as the maximum
size.  MOVE_MAX is defined to be anywhere from 1 (avr.h) to 8 (sparc.h) to 16
(i386.h).  The test assumes that accesses of up to 8 bytes will be folded so it
will fail on all the targets where MOVE_MAX is less than 8.  Even for sizes
that do fit the limit the back end can decide not to fold if the access is not
aligned (as the sparc back end does), and so the test will also fail on a bunch
of targets where MOVE_MAX is 8 or more.

To pass across the board, the test would need to be parameterized on these
variables.  Hardcoding them into the test would make it fragile, so it would
need to somehow extract them from the config file(s).  If that's even possible,
I'm not sure it's worth the effort.  I think the should probably only run on a
very small set of well-known targets, perhaps just x86/x86_64.  Let me make
that change.

[Bug target/83467] [7/8 Regression] ICE: in assign_by_spills, at lra-assigns.c:1476: unable to find a register to spill with -flive-range-shrinkage -m8bit-idiv

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83467

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||jakub at gcc dot gnu.org,
   ||uros at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r239511.

[Bug tree-optimization/81945] [8 Regression] ICE in operator[], at vec.h:749

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81945

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #6 from Jeffrey A. Law  ---
Per c#5.

[Bug target/83499] [8 Regression] bootstrap fails in stage3 on arm-linux-gnueabihf (as: unaligned opcodes detected in executable segment)

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83499

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Can you please attach c-omp.ii and c-omp.s on which as complains?

[Bug bootstrap/81869] [8 Regression] --enable-checking=yes,rtl failed to bootstrap on 32-bit hosts

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81869

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||law at redhat dot com
 Resolution|--- |WORKSFORME

--- Comment #8 from Jeffrey A. Law  ---
Given c#7.

[Bug rtl-optimization/83304] [8 Regression] FAIL: gcc.c-torture/execute/pr61725.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83304

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #12 from Jeffrey A. Law  ---
Fixed by Segher's patch on the trunk.

[Bug target/83368] alloca after setjmp breaks PIC base reg

2017-12-19 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83368

Eric Botcazou  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ebotcazou at gcc dot 
gnu.org

--- Comment #16 from Eric Botcazou  ---
Investigating.

[Bug target/83499] New: [8 Regression] bootstrap fails in stage3 on arm-linux-gnueabihf (as: unaligned opcodes detected in executable segment)

2017-12-19 Thread doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83499

Bug ID: 83499
   Summary: [8 Regression] bootstrap fails in stage3 on
arm-linux-gnueabihf (as: unaligned opcodes detected in
executable segment)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen with r254551 20171218 and r255822 20171219 and with a 20171213 build.

last successful bootstrap was 20171128. all builds using a recent binutils 2.29
branch.

/<>/build/./prev-gcc/xg++ -B/<>/build/./prev-gcc/
-B/usr/arm-linux-gnueabihf/bin/ -nostdinc++
-B/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/src/.libs
-B/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/libsupc++/.libs 
-I/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/include/arm-linux-gnueabihf
 -I/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/include 
-I/<>/src/libstdc++-v3/libsupc++
-L/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/src/.libs
-L/<>/build/prev-arm-linux-gnueabihf/libstdc++-v3/libsupc++/.libs
-fno-PIE -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2
-fno-stack-protector -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-I. -Ic-family -I../../src/gcc -I../../src/gcc/c-family
-I../../src/gcc/../include -I../../src/gcc/../libcpp/include 
-I../../src/gcc/../libdecnumber -I../../src/gcc/../libdecnumber/dpd
-I../libdecnumber -I../../src/gcc/../libbacktrace   -o c-family/c-omp.o -MT
c-family/c-omp.o -MMD -MP -MF c-family/.deps/c-omp.TPo
../../src/gcc/c-family/c-omp.c
/tmp/ccVKEiqc.s: Assembler messages:
/tmp/ccVKEiqc.s: Error: unaligned opcodes detected in executable segment
Makefile:1110: recipe for target 'c-family/c-omp.o' failed
make[5]: *** [c-family/c-omp.o] Error 1
make[5]: *** Waiting for unfinished jobs
rm gcov.pod fsf-funding.pod gpl.pod cpp.pod gfdl.pod gcc.pod gcov-dump.pod
gfortran.pod gcov-tool.pod gccgo.pod
make[5]: Leaving directory '/<>/build/gcc'
Makefile:4731: recipe for target 'all-stage3-gcc' failed
make[4]: *** [all-stage3-gcc] Error 2
make[4]: Leaving directory '/<>/build'
Makefile:24793: recipe for target 'stage3-bubble' failed
make[3]: *** [stage3-bubble] Error 2
make[3]: Leaving directory '/<>/build'
Makefile:24856: recipe for target 'bootstrap' failed
make[2]: *** [bootstrap] Error 2

 --enable-languages=c,ada,c++,go,fortran,objc,obj-c++
 --prefix=/usr
 --with-gcc-major-version-only
 --program-suffix=-8
 --program-prefix=arm-linux-gnueabihf-
 --enable-shared
 --enable-linker-build-id
 --libexecdir=/usr/lib
 --without-included-gettext
 --enable-threads=posix
 --libdir=/usr/lib
 --enable-nls
 --with-sysroot=/
 --enable-clocale=gnu
 --enable-libstdcxx-debug
 --enable-libstdcxx-time=yes
 --with-default-libstdcxx-abi=new
 --enable-gnu-unique-object
 --disable-libitm
 --disable-libquadmath
 --enable-plugin
 --enable-default-pie
 --with-system-zlib
 --enable-objc-gc=auto
 --enable-multiarch
 --enable-multilib
 --disable-sjlj-exceptions
 --with-arch=armv7-a
 --with-fpu=vfpv3-d16
 --with-float=hard
 --with-mode=thumb
 --disable-werror
 --enable-multilib
 --enable-checking=release
 --build=arm-linux-gnueabihf
 --host=arm-linux-gnueabihf
 --target=arm-linux-gnueabihf

[Bug preprocessor/83492] [7/8 Regression] Optimized search_line_fast breaks preprocessor on aarch64_be

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83492

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
The patch has been posted already:
http://gcc.gnu.org/ml/gcc-patches/2017-12/msg01271.html
and I don't think you need any kind of new testcase, I'd expect most of the
testsuite would fail because of this.

[Bug c++/83498] New: bogus -Wattributes for always_inline and noinline on distinct overloads

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83498

Bug ID: 83498
   Summary: bogus -Wattributes for always_inline and noinline on
distinct overloads
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

GCC 8 issues a spurious warning for distinct overloads of the same function,
one declared attribute always_inline and the other noinline:

$ cat u.C && gcc -O2 -S -Wall u.C
inline void __attribute__ ((always_inline))
bar () { }

void __attribute__ ((noinline))
bar (int) { }

u.C:5:1: warning: declaration of ‘void bar(int)’ with attribute ‘noinline’
follows inline declaration  [-Wattributes]
 bar (int) { }
 ^~~
u.C:2:1: note: previous definition of ‘void bar()’ was here
 bar () { }
 ^~~

Prior to r255469, GCC would print the following two equally incorrect warnings:

u.C: In function ‘void bar(int)’:
u.C:5:1: warning: function ‘void bar(int)’ redeclared with attribute noinline
[-Wattributes]
 bar (int) { }
 ^~~
u.C:2:1: note: previous declaration of ‘void bar()’ was inline
 bar () { }
 ^~~
u.C:5:1: warning: function ‘void bar(int)’ redeclared with attribute noinline
[-Wattributes]
 bar (int) { }
 ^~~
u.C:2:1: note: previous declaration of ‘void bar()’ was inline
 bar () { }

[Bug other/83497] New: CPU2000 172.mgrid starts failing with r254730

2017-12-19 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83497

Bug ID: 83497
   Summary: CPU2000 172.mgrid starts failing with r254730
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pthaugen at gcc dot gnu.org
CC: dje at gcc dot gnu.org, hubicka at gcc dot gnu.org,
rguenth at gcc dot gnu.org, segher at gcc dot gnu.org,
wschmidt at gcc dot gnu.org
  Target Milestone: ---
  Host: powerpc64-unknown-linux-gnu
Target: powerpc64-unknown-linux-gnu
 Build: powerpc64-unknown-linux-gnu

mgrid started failing (output miscompare) with r254730. The following options
demonstrate the failure "-O3 -mcpu=power6 -ffast-math". The miscompared output
is...

29748: -0.839533E-12
   0.182462E-12
  ^
29749: -0.839533E-12
   0.182462E-12
  ^
29750: -0.849589E-12
   0.184648E-12
  ^
29751: -0.849589E-12
   0.184648E-12
  ^
29752: -0.852151E-12
   0.185205E-12
  ^
29753: -0.852151E-12
   0.185205E-12
  ^
29754: -0.852839E-12
   0.185354E-12
  ^

A little brief history on this since it's come and gone a couple times. All
revisions deal with CFG/inlining issues.

r254730 - initial failure
r254937 - started working, only because this inadvertently disabled some
inlining
r254946 - fixed inlining from 254937, benchmark started failing again
r255103 - started working

So even though it's currently working on trunk I think there's an issue in
r255103 which I've emailed Honza about separately. If I apply the following
(which hopefully Honza will confirm is the desired behavior) to current trunk
the benchmark fails again.


Index: gcc/ipa-inline.c
===
--- gcc/ipa-inline.c(revision 255838)
+++ gcc/ipa-inline.c(working copy)
@@ -691,7 +691,7 @@
   sreal time = compute_uninlined_call_time (e, unspec_time);
   sreal inlined_time = compute_inlined_call_time (e, spec_time);

-  if (time - inlined_time * 100
+  if ((time - inlined_time) * 100
   > (sreal) (time * PARAM_VALUE (PARAM_INLINE_MIN_SPEEDUP)))
 return true;
   return false;

[Bug c++/82593] Internal compiler error: in process_init_constructor_array, at cp/typeck2.c:1294

2017-12-19 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82593

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #4 from Paolo Carlini  ---
Fixed.

[Bug c++/82593] Internal compiler error: in process_init_constructor_array, at cp/typeck2.c:1294

2017-12-19 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82593

--- Comment #3 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Tue Dec 19 22:14:59 2017
New Revision: 255845

URL: https://gcc.gnu.org/viewcvs?rev=255845=gcc=rev
Log:
/cp
2017-12-19  Paolo Carlini  

PR c++/82593
* decl.c (check_array_designated_initializer): Not static.
* cp-tree.h (check_array_designated_initializer): Declare.
* typeck2.c (process_init_constructor_array): Call the latter.
* parser.c (cp_parser_initializer_list): Check the return value
of require_potential_rvalue_constant_expression.

/testsuite
2017-12-19  Paolo Carlini  

PR c++/82593
* g++.dg/cpp0x/desig2.C: New.
* g++.dg/cpp0x/desig3.C: Likewise.
* g++.dg/cpp0x/desig4.C: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/desig2.C
trunk/gcc/testsuite/g++.dg/cpp0x/desig3.C
trunk/gcc/testsuite/g++.dg/cpp0x/desig4.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/typeck2.c

[Bug c++/83322] [8 Regression] r255469 causes: ICE: tree check: expected class ‘type’, have ‘exceptional’ (baselink) in diag_attr_exclusions, at attribs.c:393

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83322

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Martin Sebor  ---
Fixed via r255844.

[Bug c++/83394] [8 Regression] always_inline vs. noinline no longer diagnosed

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83394

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Martin Sebor  ---
The warning has been restored in r255844.  GCC now prints:

a.c:5:18: warning: ignoring attribute ‘always_inline’ because it conflicts with
attribute ‘noinline’ [-Wattributes]
 A::operator int ()
  ^
a.c:2:33: note: previous declaration here
   __attribute__((__noinline__)) operator int ();
 ^~~~

[Bug target/83335] [8 regression][aarch64,ilp32] gcc.target/aarch64/asm-2.c ICEs since 255481

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83335

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org,
   ||rsandifo at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
Confirmed.

[Bug c++/83322] [8 Regression] r255469 causes: ICE: tree check: expected class ‘type’, have ‘exceptional’ (baselink) in diag_attr_exclusions, at attribs.c:393

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83322

--- Comment #8 from Martin Sebor  ---
Author: msebor
Date: Tue Dec 19 22:09:00 2017
New Revision: 255844

URL: https://gcc.gnu.org/viewcvs?rev=255844=gcc=rev
Log:
PR c++/83394 - always_inline vs. noinline no longer diagnosed
PR c++/83322 - ICE: tree check: expected class ‘type’, have ‘exceptional’

gcc/cp/ChangeLog:

PR c++/83394
PR c++/83322
* decl2.c (cplus_decl_attributes): Look up member functions
in the scope of their class.

gcc/testsuite/ChangeLog:

PR c++/83394
* g++.dg/Wattributes-3.C: New test.
* g++.dg/Wattributes-4.C: New test.
* g++.dg/Wattributes-5.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/Wattributes-3.C
trunk/gcc/testsuite/g++.dg/Wattributes-4.C
trunk/gcc/testsuite/g++.dg/Wattributes-5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/83394] [8 Regression] always_inline vs. noinline no longer diagnosed

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83394

--- Comment #6 from Martin Sebor  ---
Author: msebor
Date: Tue Dec 19 22:09:00 2017
New Revision: 255844

URL: https://gcc.gnu.org/viewcvs?rev=255844=gcc=rev
Log:
PR c++/83394 - always_inline vs. noinline no longer diagnosed
PR c++/83322 - ICE: tree check: expected class ‘type’, have ‘exceptional’

gcc/cp/ChangeLog:

PR c++/83394
PR c++/83322
* decl2.c (cplus_decl_attributes): Look up member functions
in the scope of their class.

gcc/testsuite/ChangeLog:

PR c++/83394
* g++.dg/Wattributes-3.C: New test.
* g++.dg/Wattributes-4.C: New test.
* g++.dg/Wattributes-5.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/Wattributes-3.C
trunk/gcc/testsuite/g++.dg/Wattributes-4.C
trunk/gcc/testsuite/g++.dg/Wattributes-5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/testsuite/ChangeLog

[Bug preprocessor/83492] [7/8 Regression] Optimized search_line_fast breaks preprocessor on aarch64_be

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83492

Aldy Hernandez  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |aldyh at gcc dot gnu.org

--- Comment #3 from Aldy Hernandez  ---
Ok Jeff.  I'll take a look.

[Bug debug/83157] [8 regression] gcc.dg/guality/pr41616-1.c fail

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83157

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Aldy Hernandez  ---
Confirmed.

[Bug target/82975] [6/7 Regression] ICE in baseness at rtlanal.c:6220

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82975

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Tue Dec 19 21:55:23 2017
New Revision: 255843

URL: https://gcc.gnu.org/viewcvs?rev=255843=gcc=rev
Log:
PR target/82975
* gcc.dg/pr82975.c: Only add -mtune=cortex-a57 on arm*/aarch64*
targets.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/pr82975.c

[Bug tree-optimization/83493] FAIL: gcc.dg/graphite/pr70045.c (internal compiler error)

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83493

Tom de Vries  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #3 from Tom de Vries  ---
Patch committed, test-case passes again, marking resolved-fixed.

[Bug tree-optimization/83126] [8 Regression] ICE in transform_to_exit_first_loop_alt, at tree-parloops.c:1713

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83126

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
This test has a write to *fd where fd is uninitialized.

Also, the set to fd looks weird:

fd = *fd;

fd is an int *, and you're trying to set the pointer to the value of a short?

I've fixed the uninitialized problem, while leaving the short to int * move,
and I still get an ICE, so... confirmed:

void
ew (unsigned short int c9, int stuff)
{
  int e1;

  for (;;)
{
  unsigned int *by = 
  int *fd = 

  *fd = c9;
  fd = *fd;
  if (*fd != 0)
for (*by = 0; *by < 2; ++*by)
  c9 *= e1;
}
}

We are failing the following assert in transform_to_exit_first_loop_alt:

  struct reduction_info *red = reduction_phi (reduction_list, phi);
  gcc_assert (virtual_operand_p (res_a)
  || res_a == control
  || red != NULL);

(gdb) call debug_generic_stmt(res_a)
e1_27

(gdb) call debug_generic_stmt(control)
ivtmp_8

FWIW, the defining PHI statement for ivtmp_8 looks weird:

  # ivtmp_8 = PHI <(17)>

As do other PHIs:
  # c9_29 = PHI <(8), (15)>
  # e1_30 = PHI <(8), (15)>

[Bug tree-optimization/83493] FAIL: gcc.dg/graphite/pr70045.c (internal compiler error)

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83493

--- Comment #2 from Tom de Vries  ---
Author: vries
Date: Tue Dec 19 21:49:20 2017
New Revision: 255842

URL: https://gcc.gnu.org/viewcvs?rev=255842=gcc=rev
Log:
Fix sharing in translate_isl_ast_node_for

2017-12-19  Tom de Vries  

PR tree-optimization/83493
* graphite-isl-ast-to-gimple.c (translate_isl_ast_node_for): Unshare ub
and lb.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/graphite-isl-ast-to-gimple.c

[Bug preprocessor/83492] [7/8 Regression] Optimized search_line_fast breaks preprocessor on aarch64_be

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83492

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org,
   ||law at redhat dot com

--- Comment #2 from Jeffrey A. Law  ---
Aldy, want to run with this one?  I think the libcpp patch itself is obvious. 
You just need to wire up a testcase...

[Bug tree-optimization/83081] [8 regression][arm] gcc.dg/pr80218.c fails since r254888

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83081

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
I can't reproduce with a hacked up cross, so I may be missing something.

Could the original reporter verify this is still an issue?

For the record, this is how I am trying to reproduce:

~/src/gcc/configure --enable-languages=c,c++ --disable-bootstrap
--disable-multilib --target=arm-none-linux-gnueabi

"Preprocessed" source:

tor:~/bld/t/gcc$ cat pr80218.c
/* { dg-options "-O2 -fdump-rtl-ira-details-blocks" } */
/* { dg-require-effective-target c99_runtime } */

//#include 
extern float sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float acosf (float __x) __attribute__ ((__nothrow__ , __leaf__));

void foo (float *);

void
f1 (float *x)
{
  x[0] = sqrtf (x[0]);
}

void
f2 (float *x)
{
  sqrtf (x[0]);
  foo (x);
}

void
f3 (float *x)
{
  acosf (x[0]);
  foo (x);
}

/* { dg-final { scan-rtl-dump-not "Invalid sum" "ira" } } */

tor:~/bld/t/gcc$ ./cc1  pr80218.c  -quiet -O2 -fdump-rtl-ira-details-blocks
-I/tmp
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
during RTL pass: final
pr80218.c: In function ‘f1’:
pr80218.c:14:1: internal compiler error: Aborted

I am ignoring the above ICE, as it's probably unrelated and happens past the
IRA pass the test cares about:

tor:~/bld/t/gcc$ grep Invalid.sum  pr80218.c.275r.ira 
tor:~/bld/t/gcc$

[Bug c++/82213] Please warn about const rvalue reference parameters [void func(const T&&);]

2017-12-19 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82213

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #2 from Paolo Carlini  ---
Looking into it.

[Bug other/82965] [8 regression][armeb] gcc.dg/vect/pr79347.c starts failing after r254379

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82965

Aldy Hernandez  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org

--- Comment #2 from Aldy Hernandez  ---
Adding more information taken from duplicate pr82860.  Perhaps someone can
bisect and/or confirm this.

Between 20171103 (r254366) and 20171105 (r254430), a testcase regressed on
Solaris/SPARC and Linux/IA64, both 32 and 64-bit:

[Bug c++/82231] [7/8 Regression] ICE when deducing non-type template parameter value whose type depends on a non-type `auto` template parameter from function arguments

2017-12-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82231

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Marek Polacek  ---
Done.

[Bug testsuite/83483] [8 Regression] gcc.dg/memcpy-6.c FAILs

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83483

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug c++/82231] [7/8 Regression] ICE when deducing non-type template parameter value whose type depends on a non-type `auto` template parameter from function arguments

2017-12-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82231

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Tue Dec 19 20:44:19 2017
New Revision: 255839

URL: https://gcc.gnu.org/viewcvs?rev=255839=gcc=rev
Log:
PR c++/82231
* g++.dg/cpp1z/nontype-auto14.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto14.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug testsuite/83483] [8 Regression] gcc.dg/memcpy-6.c FAILs

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83483

--- Comment #3 from Aldy Hernandez  ---
Is this still an issue?  Or is it no longer a ppc64 issue?

$ uname -a
Linux gcc1-power7.osuosl.org 3.10.0-514.26.2.el7.ppc64 #1 SMP Mon Jul 10
02:26:53 GMT 2017 ppc64 ppc64 ppc64 GNU/Linux

~/src/gcc/configure --disable-bootstrap --disable-multilib --enable-languages=c
 --with-isl=$HOME/bld/isl-0.15/install
...
LD_LIBRARY_PATH=~/bld/isl-0.15/install/lib/ make check-gcc
RUNTESTFLAGS=dg.exp=memcpy-6.c

# of expected passes6

[Bug middle-end/77608] missing protection on trivially detectable runtime buffer overflow

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77608

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic, patch
 Status|ASSIGNED|NEW
  Known to work||8.0

--- Comment #4 from Martin Sebor  ---
A more modest patch, one that only enhances warnings without changing the
result of __builtin_object_size, has been committed in r255836.
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01552.html

I'm not working on the __builtin_object_size patch at this time so I'm
unassigning myself from this bug.

[Bug rtl-optimization/83480] [8 Regression] ICE in create_block_for_bookkeeping, at sel-sched.c:4557 on 32-bit BE powerpc target

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83480

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
Confirmed on gcc110 with:

~/src/gcc/configure --disable-bootstrap --disable-multilib --enable-languages=c
 --with-isl=$HOME/bld/isl-0.15/install
...
...
LD_LIBRARY_PATH=~/bld/isl-0.15/install/lib/ ./cc1 a.c -quiet -g -O2
-fselective-scheduling2 -fsel-sched-pipelining -fgcse-sm -floop-parallelize-all
-fno-tree-loop-im -m32

[Bug target/83496] MIPS BE: wrong code generates under "-Os -mbranch-cost=1"

2017-12-19 Thread g...@hauke-m.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83496

--- Comment #1 from Hauke Mehrtens  ---
I only tested the GCC 7.X snapshot from 14. December 2017, not the GCC 8.X
version.

[Bug tree-optimization/81949] DOM fails to simplify conditional

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81949

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Jeffrey A. Law  ---
Fixed by Dec 2017 changes to DOM.

[Bug target/81550] [8 regression] gcc.target/powerpc/loop_align.c fails starting with r250482

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81550

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Aldy Hernandez  ---
Confirmed.

[Bug middle-end/83477] [8 Regression] Wrong code w/ -O1

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83477

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Jeffrey A. Law  ---
Fixed on the trunk.

[Bug middle-end/83477] [8 Regression] Wrong code w/ -O1

2017-12-19 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83477

--- Comment #5 from Jeffrey A. Law  ---
Author: law
Date: Tue Dec 19 20:13:04 2017
New Revision: 255837

URL: https://gcc.gnu.org/viewcvs?rev=255837=gcc=rev
Log:
PR tree-optimization/83477
* tree-ssa-threadedge.c (record_temporary_equivalences_from_phis): For
a non-virtual PHI, always push a new range.

PR tree-optimization/83477
* gcc.c-torture/execute/pr83477.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr83477.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-threadedge.c

[Bug testsuite/83483] [8 Regression] gcc.dg/memcpy-6.c FAILs

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83483

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
So do we need this then?
2017-12-19  Jakub Jelinek  

PR testsuite/83483
* gcc.dg/memcpy-6.c: Expect no memcpy and memmove only on
non_strict_align targets.

--- gcc/testsuite/gcc.dg/memcpy-6.c 2017-12-18 14:57:15.046134391 +0100
+++ gcc/testsuite/gcc.dg/memcpy-6.c 2017-12-19 21:03:40.954255972 +0100
@@ -36,5 +36,5 @@ void fold_move_8 (void)
   __builtin_memmove (a + 3, a, 8);
 }

-/* { dg-final { scan-tree-dump-not "memcpy" "optimized" } }
-   { dg-final { scan-tree-dump-not "memmove" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "memcpy" "optimized" { target {
non_strict_align } } } }
+   { dg-final { scan-tree-dump-not "memmove" "optimized" { target {
non_strict_align } } } } */

[Bug rtl-optimization/81025] [8 Regression] gcc ICE while building glibc for MIPS soft-float multi-lib variant

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81025

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #11 from Aldy Hernandez  ---
I cannot reproduce the testcase on comment 4 either on trunk or at r247049.

abulafia:/build/t/gcc$ ./cc1 -O2 -msoft-float -mabi=32 b.c  -std=gnu11
-fgnu89-inline  -O2 -fmerge-all-constants -fno-stack-protector -frounding-math
-g -I/tmp -quiet
abulafia:/build/t/gcc$ 

This is for a cross built with:

/dir/configure --target=mips-mti-linux-gnu --enable-languages=c
--disable-decimal-float --with-mips-plt

Doug could you please reconfirm with the latest attachment in comment 4?

[Bug c++/83490] [8 Regression] ICE in find_call_stack_args, at dce.c:392

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83490

--- Comment #6 from Jakub Jelinek  ---
--- gcc/calls.c.jj  2017-12-18 14:57:24.0 +0100
+++ gcc/calls.c 2017-12-19 19:46:40.466045457 +0100
@@ -2382,7 +2382,12 @@ compute_argument_addresses (struct arg_d
  args[i].stack = gen_rtx_MEM (partial_mode, addr);
  set_mem_size (args[i].stack, units_on_stack);
}
- else
+ else if (TYPE_EMPTY_P (TREE_TYPE (args[i].tree_value)))
+   {
+ args[i].stack = gen_rtx_MEM (BLKmode, addr);
+ set_mem_size (args[i].stack, 0);
+   }
+ else  
{
  args[i].stack = gen_rtx_MEM (args[i].mode, addr);
  set_mem_attributes (args[i].stack,

avoids the ICE.  But I think I prefer:
--- gcc/calls.c.jj  2017-12-18 14:57:24.0 +0100
+++ gcc/calls.c 2017-12-19 20:25:00.143659975 +0100
@@ -2365,6 +2365,9 @@ compute_argument_addresses (struct arg_d
  && args[i].partial == 0)
continue;

+ if (TYPE_EMPTY_P (TREE_TYPE (args[i].tree_value)))
+   continue;
+
  /* Pointer Bounds are never passed on the stack.  */
  if (POINTER_BOUNDS_P (args[i].tree_value))
continue;
which I'll bootstrap/regtest together with the testcase momentarily.

[Bug target/83496] New: MIPS BE: wrong code generates under "-Os -mbranch-cost=1"

2017-12-19 Thread g...@hauke-m.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83496

Bug ID: 83496
   Summary: MIPS BE: wrong code generates under "-Os
-mbranch-cost=1"
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: g...@hauke-m.de
  Target Milestone: ---

Created attachment 42924
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42924=edit
Test case

"mips-buildroot-linux-gnu-gcc test.c -o test2 -Os -mbranch-cost=1" generates
wrong code for me.
This was seen with GCC 7.2 for MIPS32 r2 BE in OpenWrt / LEDE and with the free
electrons toolchain. I also tested the GCC snapshot from 14. December 2017 and
saw the same problem.

This is the code:


int mytest(mp_int * a, mp_digit b)
{
  /* compare based on sign */
  if (a->sign == 1) {
return -1;
  }

  /* compare based on magnitude */
  if (a->used > 1) {
return 1;
  }

  /* compare the only digit of a to b */
  if (a->dp[0] > b) {
return 1;
  } else if (a->dp[0] < b) {
return -1;
  } else {
return 0;
  }
}


This is the wrong ASM:

004006c0 :
  4006c0:   8c830008lw  v1,8(a0)
  4006c4:   24020001li  v0,1
  4006c8:   1062000cbeq v1,v0,4006fc 
  4006cc:   2402li  v0,-1
  4006d0:   8c83lw  v1,0(a0)
  4006d4:   28630002sltiv1,v1,2
  4006d8:   1068beqzv1,4006fc 
  4006dc:   nop
  4006e0:   8c82000clw  v0,12(a0)
  4006e4:   8c42lw  v0,0(v0)
  4006e8:   00a2182bsltuv1,a1,v0
  4006ec:   1465bnezv1,400704 
  4006f0:   nop
  4006f4:   0045102bsltuv0,v0,a1
  4006f8:   00021023neguv0,v0
  4006fc:   03e8jr  ra
  400700:   nop
  400704:   03e8jr  ra
  400708:   24020001li  v0,1
  40070c:   nop

In line 4006dc it should say "li v0,1" instead of nop. This code will return -1
 if "if (a->used > 1) " is true, but it should return 1.

I have also attached the code and compiled it with:
~/mips32--glibc--bleeding-edge/bin/mips-buildroot-linux-gnu-gcc test.c -o test2
-Os -mbranch-cost=1

When I compile it without "-mbranch-cost=1" it generates correct code. 
When I use this it also generates correct code:
~/mips32--glibc--bleeding-edge/bin/mips-buildroot-linux-gnu-gcc test.c -o test4
-Os -mbranch-cost=1 -funroll-loops

[Bug rtl-optimization/83162] [6/7/8 Regression] x86-64 -Wclobbered issuing more false alarms (regression)

2017-12-19 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83162

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 CC||aldyh at gcc dot gnu.org,
   ||aoliva at gcc dot gnu.org,
   ||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Aldy Hernandez  ---
Confirmed.

[Bug middle-end/77608] missing protection on trivially detectable runtime buffer overflow

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77608

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Tue Dec 19 19:14:57 2017
New Revision: 255836

URL: https://gcc.gnu.org/viewcvs?rev=255836=gcc=rev
Log:
PR middle-end/77608 - missing protection on trivially detectable runtime buffer
overflow

gcc/ChangeLog:

PR middle-end/77608
* builtins.c (compute_objsize): Handle non-constant offsets.

gcc/testsuite/ChangeLog:

PR middle-end/77608
* gcc.dg/Wstringop-overflow.c: New test.
* gcc/testsuite/c-c++-common/Warray-bounds-3.c: Adjust.


Added:
trunk/gcc/testsuite/gcc.dg/Wstringop-overflow.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/Warray-bounds-3.c

[Bug rtl-optimization/83327] Spilling into hard regs not taken into account in lra liveness analysis

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83327

--- Comment #8 from Tom de Vries  ---
(In reply to Tom de Vries from comment #7)
> (In reply to Tom de Vries from comment #6)
> > Submitted: https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01030.html
> 
> Approved. Todo: testing.

Bootstrap and reg-test on x86_64 done.

Todo: mips testing.

[Bug demangler/83495] Segmentation Fault - 63915465

2017-12-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83495

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-12-19
 Ever confirmed|0   |1

--- Comment #3 from Andrew Pinski  ---
(In reply to ktkachov from comment #1)
> Hi!
> 
> The binutils project has its own bug tracker at
> https://sourceware.org/bugzilla/
> Please do file a bug report there.

Reopening since the demangler sources are held as part of GCC sources.

Note we do need a better testcase and one not using docker.  Say one written in
simple C++ using __cxa_demangle.

[Bug demangler/83495] Segmentation Fault - 63915465

2017-12-19 Thread security-tps at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83495

Google-Autofuzz  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|WONTFIX |---

--- Comment #2 from Google-Autofuzz  ---
Hmm.  We did that, and binutils team pointed us here: 
https://sourceware.org/bugzilla/show_bug.cgi?id=22609  :)

Any suggestions on the best way to proceed?


Thanks!

[Bug c/30552] gcc crashes when compiling examples with GNU statement expressions in VLAs (also involved: nested functions declared K)

2017-12-19 Thread dave.pagan at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30552

--- Comment #6 from Dave Pagan  ---
(In reply to Eric Gallager from comment #5)
> (In reply to Dave Pagan from comment #4)
> > It appears this is a case where ICEs are the result of poor error
> > detection/recovery with statement expressions in these contexts. Has anyone
> > else looked into this? If not, I'd like to investigate it further to verify
> > what I'm seeing and come up with a solution.
> 
> Not that I know of; please go ahead!

Great. Thanks for the quick response, Eric.

[Bug demangler/83495] Segmentation Fault - 63915465

2017-12-19 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83495

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||ktkachov at gcc dot gnu.org
 Resolution|--- |WONTFIX

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Hi!

The binutils project has its own bug tracker at
https://sourceware.org/bugzilla/
Please do file a bug report there.

[Bug demangler/83495] New: Segmentation Fault - 63915465

2017-12-19 Thread security-tps at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83495

Bug ID: 83495
   Summary: Segmentation Fault - 63915465
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: demangler
  Assignee: unassigned at gcc dot gnu.org
  Reporter: security-tps at google dot com
  Target Milestone: ---

Created attachment 42923
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42923=edit
Dockerfile + PoC

Hello gcc team,

As part of our fuzzing efforts at Google, we have identified an issue affecting
binutils (tested with revision * master
be62dcaa1771b5f2a47f0cfd78f89828f087efff).

To reproduce, we are attaching a Dockerfile which compiles the project with
LLVM, taking advantage of the sanitizers that it offers. More information about
how to use the attached Dockerfile can be found here:
https://docs.docker.com/engine/reference/builder/

TL;DR instructions:
* `mkdir project`
* `cp Dockerfile /path/to/project`
* `docker build --no-cache /path/to/project`
* `docker run -it image_id_from_docker_build`

From another terminal, outside the container:
`docker cp /path/to/attached/reproducer
running_container_hostname:/fuzzing/reproducer`
(reference: https://docs.docker.com/engine/reference/commandline/cp/)

And, back inside the container:
`/fuzzing/repro.sh /fuzzing/reproducer`

Alternatively, and depending on the bug, you could use gcc, valgrind or other
instrumentation tools to aid in the investigation. The sanitizer error that we
encountered is here:

ASAN:DEADLYSIGNAL
=
==9==ERROR: AddressSanitizer: SEGV on unknown address 0x (pc
0x0051a110 bp 0x7fff56532440 sp 0x7fff56532410 T0)
==9==The signal is caused by a READ memory access.
==9==Hint: address points to the zero page.
#0 0x51a10f in d_encoding
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:1332:46
#1 0x519dc7 in cplus_demangle_mangled_name
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:1230:7
#2 0x51edda in d_demangle_callback
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:6242:7
#3 0x51e8c8 in d_demangle
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:6293:12
#4 0x51e7db in cplus_demangle_v3
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:6450:10
#5 0x50a81a in cplus_demangle
/fuzzing/binutils-gdb/libiberty/cplus-dem.c:880:13
#6 0x50847d in LLVMFuzzerTestOneInput
/fuzzing/binutils-gdb/build/../libiberty/demangle_fuzzer.cc:11:20
#7 0x5376ec in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*,
unsigned long) (/fuzzing/binutils-gdb/build/demangle_fuzzer+0x5376ec)
#8 0x536eae in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long)
(/fuzzing/binutils-gdb/build/demangle_fuzzer+0x536eae)
#9 0x530d0d in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*)
(/fuzzing/binutils-gdb/build/demangle_fuzzer+0x530d0d)
#10 0x5321df in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char
const*, unsigned long)) (/fuzzing/binutils-gdb/build/demangle_fuzzer+0x5321df)
#11 0x530bbc in main (/fuzzing/binutils-gdb/build/demangle_fuzzer+0x530bbc)
#12 0x7fa7e9b152b0 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
#13 0x41db69 in _start
(/fuzzing/binutils-gdb/build/demangle_fuzzer+0x41db69)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/fuzzing/binutils-gdb/libiberty/cp-demangle.c:1332:46 in d_encoding
==9==ABORTING


We will gladly work with you so you can successfully confirm and reproduce this
issue. Do let us know if you have any feedback surrounding the documentation.

Once you have reproduced the issue, we'd appreciate to learn your expected
timeline for an update to be released. With any fix, please attribute the
report
to "Google Autofuzz project".

We are also pleased to inform you that your project is eligible for inclusion
to
the OSS-Fuzz project, which can provide additional continuous fuzzing, and
encourage you to investigate integration options.

Don't hesitate to let us know if you have any questions!

Google AutoFuzz Team

[Bug c++/83490] [8 Regression] ICE in find_call_stack_args, at dce.c:392

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83490

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
I think the problem is clear:
(call_insn/u 7 4 14 2 (set (reg:QI 0 ax)
(call (mem:QI (symbol_ref:DI ("_Zlt1AS_") [flags 0x3]  ) [0 operator< S1 A8])
(const_int 0 [0]))) 690 {*call_value}
 (expr_list:REG_EH_REGION (const_int 0 [0])
(nil))
(expr_list:QI (use (mem:QI (reg/f:DI 7 sp) [0  S1 A64]))
(expr_list:QI (use (mem:QI (reg/f:DI 7 sp) [0  S1 A64]))
(nil
Note the two entries in CALL_INSN_FUNCTION_USAGE that have both size 1 and
overlap each other.  That is of course a big no no.
If the arguments are passed such that occupy no space at all, then we shouldn't
be adding C_I_F_U entries for them (but then e.g. var-tracking will be unhappy
as it won't be able to properly find other arguments) or ensure the MEMs have
zero size.  If you don't mind, I'll have a look.

[Bug c++/83490] [8 Regression] ICE in find_call_stack_args, at dce.c:392

2017-12-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83490

--- Comment #4 from Marek Polacek  ---
Reproducible with just:

struct A {};
A operator<(A, A) { return A(); }
A operator>(A, A) { return A(); }

[Bug rtl-optimization/83459] [8 Regression] ICE: qsort checking failed: qsort comparator non-negative on sorted output: 1 with --param=sched-pressure-algorithm=2

2017-12-19 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83459

Alexander Monakov  changed:

   What|Removed |Added

 Blocks||82407

--- Comment #2 from Alexander Monakov  ---
I agree with the analysis. Insns where INSN_BB (i) != target_bb correspond to
(likely speculative) insns outside of current basic block, so for
SCHED_PRESSURE_MODEL we definitely want to sort them _after_ insns from
target_bb. When both insns are outside of current bb we can defer to next
tiebreakers.

The following (completely untested) patch implements this change. I can run it
through a bootstrap/regtest cycle if it looks reasonable:

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 549e8961411..f169d57a634 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2783,12 +2783,20 @@ rank_for_schedule (const void *x, const void *y)
 }

   /* Prefer instructions that occur earlier in the model schedule.  */
-  if (sched_pressure == SCHED_PRESSURE_MODEL
-  && INSN_BB (tmp) == target_bb && INSN_BB (tmp2) == target_bb)
+  if (sched_pressure == SCHED_PRESSURE_MODEL)
 {
-  diff = model_index (tmp) - model_index (tmp2);
-  gcc_assert (diff != 0);
-  return rfs_result (RFS_PRESSURE_INDEX, diff, tmp, tmp2);
+  if (INSN_BB (tmp) == target_bb)
+   {
+ if (INSN_BB (tmp2) == target_bb)
+   {
+ diff = model_index (tmp) - model_index (tmp2);
+ gcc_assert (diff != 0);
+ return rfs_result (RFS_PRESSURE_INDEX, diff, tmp, tmp2);
+   }
+ return rfs_result (RFS_PRESSURE_INDEX, -1, tmp, tmp2);
+   }
+  if (INSN_BB (tmp2) == target_bb)
+   return rfs_result (RFS_PRESSURE_INDEX, 1, tmp, tmp2);
 }

   /* Prefer the insn which has more later insns that depend on it.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82407
[Bug 82407] [meta-bug] qsort_chk fallout tracking

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

Alexandre Oliva  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #83 from Alexandre Oliva  ---
Having installed the pending patch that fixed the last known problem reported
in this PR, I think we're ready to close it.  If you know or find otherwise,
please reopen or add a comment with info about the problem.  Or perhaps open a
separate bug and copy me, considering it's not likely to be the same issue any
more, even if it's related with SFN in some way.

There's still some pending cleanup (patches in comments 76 and 77) that I'm
testing and that should be installed with a reference to this PR, but it's a
cleanup, not a fix, so I won't keep this open just on those grounds.

Thanks everyone for your help in providing information about problems that
popped up, and patience until they got addressed.

[Bug target/83105] [8 regression] arm-*-*eabihf: error: -mfloat-abi=hard: selected processor lacks an FPU

2017-12-19 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83105

Richard Earnshaw  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-12-19
 Ever confirmed|0   |1

[Bug fortran/83436] Internal file cannot be accessed by UNFORMATTED data transfer when reading from /dev/urandom

2017-12-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83436

--- Comment #11 from Thomas Koenig  ---
The problem went away after updating to a clean trunk,
re-bootstrapping and installing.

Let's try gcc-7 next...

[Bug debug/83422] [8 Regression] ICE: in final_scan_insn, at final.c:2429 after "variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without"

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83422

Alexandre Oliva  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Alexandre Oliva  ---
Fixed

[Bug tree-optimization/83444] [5/6/7 Regression] missing strlen optimization on a member array of a local struct

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83444

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Tue Dec 19 18:10:04 2017
New Revision: 255835

URL: https://gcc.gnu.org/viewcvs?rev=255835=gcc=rev
Log:
PR tree-optimization/83444
* tree-ssa-strlen.c (strlen_check_and_optimize_stmt): For the
character load case, if get_stridx on MEM_REF's operand doesn't
look usable, retry with get_addr_stridx.

* gcc.dg/strlenopt-38.c: New test.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/strlenopt-38.c
trunk/gcc/tree-ssa-strlen.c

[Bug target/83387] PowerPC64: Infinite loops in do_reload() with -msoft-float

2017-12-19 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83387

--- Comment #13 from Peter Bergner  ---
(In reply to Sebastian Huber from comment #12)
> (In reply to Peter Bergner from comment #9)
> [...]
> > Here, you can see that on ELFv2, we always assume HW FP regs are avialable,
> > because we're forcing usage of HW FP registers (FP_ARG_RETURN, ie, f1, aka
> > reg 33).  I'm afraid that are going to be a *LOT* of these assumptions
> > builtin into the backend and tracking them all down and fixing them is not
> > going to be easy.  That's why I asked earlier, if you really really need to
> > disable HW FP for your builds.  If you do, then good luck to you finding
> > them all.
> 
> Thanks for your investigations. I removed the 64-bit soft-float multilib.

I can't promise this is all you need, but does the following patch help?

Index: gcc/config/rs6000/rs6000.c
===
--- gcc/config/rs6000/rs6000.c  (revision 255700)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -11095,7 +11095,8 @@ rs6000_discover_homogeneous_aggregate (m
  homogeneous aggregates; these types are handled via the
  targetm.calls.split_complex_arg mechanism.  Complex types
  can be elements of homogeneous aggregates, however.  */
-  if (DEFAULT_ABI == ABI_ELFv2 && type && AGGREGATE_TYPE_P (type))
+  if (TARGET_HARD_FLOAT && DEFAULT_ABI == ABI_ELFv2 && type
+  && AGGREGATE_TYPE_P (type))
 {
   machine_mode field_mode = VOIDmode;
   int field_count = rs6000_aggregate_candidate (type, _mode);



> Would it be possible to generate a proper ICE with a user friendly error
> message if someone uses -msoft-float on this target?

We cannot, because we support building the 64-bit linux kernel (both ELFv1 and
ELFv2 - ie, BE and LE) using -msoft-float.  The reason they don't see a problem
is that the linux kernel doesn't have any explicit FP code/type usage in its C
source files.

[Bug debug/83422] [8 Regression] ICE: in final_scan_insn, at final.c:2429 after "variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without"

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83422

--- Comment #8 from Alexandre Oliva  ---
Author: aoliva
Date: Tue Dec 19 17:50:54 2017
New Revision: 255834

URL: https://gcc.gnu.org/viewcvs?rev=255834=gcc=rev
Log:
SFN: don't drop markers for skipping var-tracking

Although debug markers are more useful when bind stmts are placed
among them, there is value in keeping them even when VTA limits are
exceeded.

for  gcc/ChangeLog

PR debug/83422
* var-tracking.c (vt_debug_insns_local): Do not drop markers.
(variable_tracking_main_1): Keep markers even when VTA fails.

for  gcc/testsuite/ChangeLog

PR debug/83422
* gcc.dg/pr83422.c: New.

Added:
trunk/gcc/testsuite/gcc.dg/pr83422.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/var-tracking.c

[Bug bootstrap/83396] [8 Regression] Bootstrap failures with Statement Frontiers

2017-12-19 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83396

--- Comment #82 from Alexandre Oliva  ---
Author: aoliva
Date: Tue Dec 19 17:50:31 2017
New Revision: 255833

URL: https://gcc.gnu.org/viewcvs?rev=255833=gcc=rev
Log:
[SFN] start rtl block with label, then markers

Emitting markers before labels turned out to not be worth the trouble.
The markers outside BBs confuse the ebb scheduler, and they don't add
any useful information.  I'll arrange for markers to be moved past
labels, even in gimple, but for now this will fix the two remaining
known problems on ia64.

for  gcc/ChangeLog

PR bootstrap/83396
* cfgexpand.c (expand_gimple_basic_block): Expand label first,
even if there are markers before it.
* cfgrtl.c (rtl_verify_bb_layout): Reject DEBUG_INSNs outside BBs.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/cfgrtl.c

[Bug other/70268] add option -ffile-prefix-map to map one directory name (old) to another (new) in __FILE__, __BASE_FILE__and __builtin_FILE()

2017-12-19 Thread infinity0 at pwned dot gg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268

--- Comment #15 from infinity0 at pwned dot gg ---
(In reply to infinity0 from comment #14)
> > it has a unified option (-ffile-prefix-map) [..]
> 
> Oh, nice. That might save me some work, then.
> 
> Could you bounce me the thread? Or failing that, tell me the Message-ID of
> one of the messages, so I can reply to it.
> 
> > [..] that I believe does exactly what you want
> 

Thanks for forwarding the mail. I've posted a follow-up patch to be applied on
top of your patch, that implements the two things I mentioned.

[Bug lto/83201] [7/8 Regression] SPEC CPU2017 505.mcf_r produces incorrect output when built with -flto and FDO

2017-12-19 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201

--- Comment #19 from rguenther at suse dot de  ---
On December 19, 2017 5:42:07 PM GMT+01:00, "pthaugen at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83201
>
>--- Comment #18 from Pat Haugen  ---
>(In reply to Martin Liška from comment #16)
>> (In reply to Richard Biener from comment #15)
>> > SWAPINIT should end up with swaptype_long == 1 I think and
>swaptype_int == 1
>> > for the cases in question.  Enforcing swaptype_int = swaptype_long
>= 2
>> > should make it work (scratch SWAPINIT calls).
>> 
>> I can confirm that.
>
>Yes, that fixes the problem for me on PowerPC also. I can pass along
>the info
>to our SPEC rep.
>
>
>Richi,
>I'm curious if the alias violations were apparent in a dump file, or
>did you
>just happened to spot them looking through the source?

I just looked at the source seeing *(long *) ptr and bells went off. 

Richard.

[Bug tree-optimization/81010] [8 regression] test case gcc.target/powerpc/pr56605.c fails starting with r248958

2017-12-19 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81010

--- Comment #5 from Segher Boessenkool  ---
Oh, heh, the testcase isn't run at all on powerpc64le.  That should be fixed,
too.

[Bug tree-optimization/83491] [8 Regression] ICE in execute_cse_reciprocals_1 at gcc/tree-ssa-math-opts.c:585

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83491

--- Comment #5 from Jakub Jelinek  ---
And "in to account" should be "into account".

[Bug tree-optimization/83491] [8 Regression] ICE in execute_cse_reciprocals_1 at gcc/tree-ssa-math-opts.c:585

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83491

--- Comment #4 from Jakub Jelinek  ---
Thanks.  One more nit:
  /* If this is a square (x * x), we should check whether there are any
 enough divisions by x on it's own to warrant waiting for that pass.  */
Either whether there are any divisions, or whether there are enough divisions,
any enough doesn't make sense to me.

[Bug tree-optimization/83491] [8 Regression] ICE in execute_cse_reciprocals_1 at gcc/tree-ssa-math-opts.c:585

2017-12-19 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83491

--- Comment #3 from Wilco  ---
(In reply to Jakub Jelinek from comment #2)
> There are multiple bugs:
> 1) the callers of execute_cse_reciprocals_1 ensure that def is SSA_NAME, so
> using:
>   /* If this is a square (x * x), we should check whether there are any
>  enough divisions by x on it's own to warrant waiting for that pass.  */
>   if (TREE_CODE (def) == SSA_NAME)
> {
>   gimple *def_stmt = SSA_NAME_DEF_STMT (def);
> ...
> }
> 
>   FOR_EACH_IMM_USE_FAST (use_p, use_iter, def)
> {
>   gimple *use_stmt = USE_STMT (use_p);
> is misleading.  The thing is, the FOR_EACH_IMM_USE_FAST would fail miserably
> if
> def isn't SSA_NAME.  Please just add gcc_checking_assert (TREE_CODE (def) ==
> SSA_NAME); or gcc_assert, and reindent the body of the useless first if.
> 
> 2)
>   if (is_gimple_assign (def_stmt)
>   && gimple_assign_rhs_code (def_stmt) == MULT_EXPR
>   && gimple_assign_rhs1 (def_stmt) == gimple_assign_rhs2 (def_stmt))
> This of course needs to also verify that TREE_CODE (gimple_assign_rhs1
> (def_stmt)) == SSA_NAME.  The equality comparison afterwards is ok, as
> SSA_NAMEs are unique and can be compared with pointer comparisons.
> 
> 3) sqrt_recip_count ++;
> formatting (no space in between variable name and ++).  Happens several
> times in the function.
> 
> 4) 
>   /* Do the expensive part only if we can hope to optimize something.  */
>   if (count + square_recip_count >= threshold
>   && count >= 1)
> This condition should have been on a single line, it is short enough to fit.

Yes, I've got a fix for (2), and can easily clean up the coding style issues.

Interestingly it's possible to trigger the failure much more often with
-frounding-math (where you end up with def = const*const).

[Bug testsuite/83454] FAIL: gcc.dg/tree-ssa/cswtch-4.c and cswtch-5.c

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83454

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Dec 19 17:12:41 2017
New Revision: 255832

URL: https://gcc.gnu.org/viewcvs?rev=255832=gcc=rev
Log:
PR testsuite/83454
* gcc.dg/tree-ssa/cswtch-4.c: Require nonpic effective target.
* gcc.dg/tree-ssa/cswtch-5.c: Likewise.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/cswtch-4.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/cswtch-5.c

[Bug tree-optimization/83491] [8 Regression] ICE in execute_cse_reciprocals_1 at gcc/tree-ssa-math-opts.c:585

2017-12-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83491

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
There are multiple bugs:
1) the callers of execute_cse_reciprocals_1 ensure that def is SSA_NAME, so
using:
  /* If this is a square (x * x), we should check whether there are any
 enough divisions by x on it's own to warrant waiting for that pass.  */
  if (TREE_CODE (def) == SSA_NAME)
{
  gimple *def_stmt = SSA_NAME_DEF_STMT (def);
...
}

  FOR_EACH_IMM_USE_FAST (use_p, use_iter, def)
{
  gimple *use_stmt = USE_STMT (use_p);
is misleading.  The thing is, the FOR_EACH_IMM_USE_FAST would fail miserably if
def isn't SSA_NAME.  Please just add gcc_checking_assert (TREE_CODE (def) ==
SSA_NAME); or gcc_assert, and reindent the body of the useless first if.

2)
  if (is_gimple_assign (def_stmt)
  && gimple_assign_rhs_code (def_stmt) == MULT_EXPR
  && gimple_assign_rhs1 (def_stmt) == gimple_assign_rhs2 (def_stmt))
This of course needs to also verify that TREE_CODE (gimple_assign_rhs1
(def_stmt)) == SSA_NAME.  The equality comparison afterwards is ok, as
SSA_NAMEs are unique and can be compared with pointer comparisons.

3) sqrt_recip_count ++;
formatting (no space in between variable name and ++).  Happens several times
in the function.

4) 
  /* Do the expensive part only if we can hope to optimize something.  */
  if (count + square_recip_count >= threshold
  && count >= 1)
This condition should have been on a single line, it is short enough to fit.

[Bug rtl-optimization/83494] New: [8 Regression] ICE: in assign_by_spills, at lra-assigns.c:1468: unable to find a register to spill with -flive-range-shrinkage

2017-12-19 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83494

Bug ID: 83494
   Summary: [8 Regression] ICE: in assign_by_spills, at
lra-assigns.c:1468: unable to find a register to spill
with -flive-range-shrinkage
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 42922
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42922=edit
reduced testcase

Might be related or duplicate PR83467, but this one does not need any
target-specific flags.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -flive-range-shrinkage testcase.c
testcase.c: In function 'a':
testcase.c:8:1: error: unable to find a register to spill
 }
 ^
testcase.c:8:1: error: this is the insn:
(insn 46 49 6 2 (parallel [
(set (reg:SI 115 [ d ])
(ashift:SI (reg/v:SI 106 [ d ])
(reg:QI 125 [ f ])))
(clobber (reg:CC 17 flags))
]) "testcase.c":3 540 {*ashlsi3_1}
 (expr_list:REG_DEAD (reg:QI 125 [ f ])
(expr_list:REG_DEAD (reg/v:SI 106 [ d ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)
during RTL pass: reload
testcase.c:8:1: internal compiler error: in assign_by_spills, at
lra-assigns.c:1468
0x696c9a _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0xcf7fba assign_by_spills
/repo/gcc-trunk/gcc/lra-assigns.c:1468
0xcf8b1c lra_assign()
/repo/gcc-trunk/gcc/lra-assigns.c:1662
0xcf3404 lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2469
0xca0d99 do_reload
/repo/gcc-trunk/gcc/ira.c:5443
0xca0d99 execute
/repo/gcc-trunk/gcc/ira.c:5627
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-255786-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-255786-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 8.0.0 20171218 (experimental) (GCC)

[Bug target/82975] [6/7 Regression] ICE in baseness at rtlanal.c:6220

2017-12-19 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82975

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

Summary|[6/7/8 Regression] ICE in   |[6/7 Regression] ICE in
   |baseness at rtlanal.c:6220  |baseness at rtlanal.c:6220
  Known to fail|8.0 |

--- Comment #7 from ktkachov at gcc dot gnu.org ---
Fixed on trunk.
Will give it a bit of time to bake in before backporting.

[Bug target/82975] [6/7/8 Regression] ICE in baseness at rtlanal.c:6220

2017-12-19 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82975

--- Comment #6 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Tue Dec 19 16:58:22 2017
New Revision: 255830

URL: https://gcc.gnu.org/viewcvs?rev=255830=gcc=rev
Log:
[arm] PR target/82975: Guard against reg_renumber being NULL in arm.h

In this bug we ICE when checking REGNO_OK_FOR_INDEX_P on arm during pre-IRA
scheduling.
This is because REGNO_OK_FOR_INDEX_P ends up checking the reg_renumber array.
Before IRA reg_renumber is NULL and thus we segfault.

The fix is to guard the use of reg_renumber in the logic in TEST_REGNO in
arm.h.
On aarch64, for example, we also guard against the reg_renumber == NULL case.
This fixes the ICE. I also remove the part of the comment that muses on when
reg_renumber
is available as with this patch it should now be safe to use at any point.

Bootstrapped and tested on arm-none-linux-gnueabihf.

PR target/82975
* config/arm/arm.h (TEST_REGNO): Check reg_renumber is set before
accessing it.  Adjust comment.

* gcc.dg/pr82975.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr82975.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.h
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/83438] [8 Regression] 435.gromacs miscompares

2017-12-19 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83438

--- Comment #8 from Jeffrey A. Law  ---
Doesn't look to be the same correctness issue I'm tracking right now as I get a
mis-compare with and without those changes.  Sigh.

[Bug tree-optimization/83493] FAIL: gcc.dg/graphite/pr70045.c (internal compiler error)

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83493

Tom de Vries  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code, patch

--- Comment #1 from Tom de Vries  ---
https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01245.html

[Bug tree-optimization/83493] New: FAIL: gcc.dg/graphite/pr70045.c (internal compiler error)

2017-12-19 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83493

Bug ID: 83493
   Summary: FAIL: gcc.dg/graphite/pr70045.c (internal compiler
error)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

https://gcc.gnu.org/ml/gcc-testresults/2017-12/msg01271.html:
...
FAIL: gcc.dg/graphite/pr70045.c (internal compiler error)
FAIL: gcc.dg/graphite/pr70045.c (test for excess errors)
...

  1   2   3   >