[Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')

2018-06-10 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85088

--- Comment #8 from janus at gcc dot gnu.org ---
Author: janus
Date: Sun Jun 10 08:20:50 2018
New Revision: 261386

URL: https://gcc.gnu.org/viewcvs?rev=261386&root=gcc&view=rev
Log:
2018-06-10  Janus Weil  

PR fortran/85088
* decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
and remove a TODO note.
* gfortran.h: Add a comment to sym_intent.


2018-06-10  Janus Weil  

PR fortran/85088
* gfortran.dg/intent_decl_1.f90: New test case.

Added:
trunk/gcc/testsuite/gfortran.dg/intent_decl_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/testsuite/ChangeLog

[Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')

2018-06-10 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85088

janus at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #9 from janus at gcc dot gnu.org ---
Fixed with r261386. Closing.

[Bug fortran/54687] Use gcc option machinery for gfortran

2018-06-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54687

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P5
 Status|RESOLVED|ASSIGNED
 Resolution|FIXED   |---
   Assignee|unassigned at gcc dot gnu.org  |dominiq at lps dot 
ens.fr

--- Comment #17 from Dominique d'Humieres  ---
Let me have a deeper look at what can be done.

[Bug fortran/79854] diagnostics: gfc_conv_constant_to_tree should be gfc_internal_error

2018-06-10 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79854

--- Comment #6 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Sun Jun 10 12:50:03 2018
New Revision: 261387

URL: https://gcc.gnu.org/viewcvs?rev=261387&root=gcc&view=rev
Log:
2018-06-10  Dominique d'Humieres  

PR fortran/79854
* trans-const.c: Remove include "diagnostic-core.h".
(gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-const.c

[Bug fortran/79854] diagnostics: gfc_conv_constant_to_tree should be gfc_internal_error

2018-06-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79854

Dominique d'Humieres  changed:

   What|Removed |Added

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

--- Comment #7 from Dominique d'Humieres  ---
Closing.

[Bug fortran/86100] New: Spurious error with -fcheck=bounds and allocatable class(*) array components

2018-06-10 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86100

Bug ID: 86100
   Summary: Spurious error with -fcheck=bounds and allocatable
class(*) array components
   Product: gcc
   Version: 8.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

When compiled with -fcheck=bounds, the following example gives a spurious
runtime bound mismatch error on the 'b=a' assignment statement:

type any_matrix
  class(*), allocatable :: m(:,:)
end type
type(any_matrix) :: a, b
allocate(a%m, source=reshape([3,5],shape=[1,2]))
b = a ! SPURIOUS RUNTIME ERROR with -fcheck=bounds
end

At line 6 of file gfortran-20180610.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array
'<>' (2/1)

Without the -fcheck=bounds option the assignment executes correctly (checked
via adding code to examine b%m).

There are no problems if the array component is rank-1, or if it is declared
integer instead of class(*). So this issue seems confined to allocatable
class(*) components of rank 2 (or greater?)

[Bug tree-optimization/86101] New: [8/9 Regression] IEEE_UNDERFLOW_FLAG in 416.gamess with -Ofast -march=native on bdver4

2018-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86101

Bug ID: 86101
   Summary: [8/9 Regression] IEEE_UNDERFLOW_FLAG in 416.gamess
with -Ofast -march=native on bdver4
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org
Blocks: 26163
  Target Milestone: ---

Starting from r259592 the benchmark fails:


Contents of h2ocu2+.gradient.err

Note: The following floating-point exceptions are signalling:
IEEE_UNDERFLOW_FLAG




Contents of triazolium.err

Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG



*** Miscompare of cytosine.2.out; for details see
   
/home/gcc/buildworker/source/cpu2006/benchspec/CPU2006/416.gamess/run/run_peak_ref_amd64-m64-mine.0001/cytosine.2.out.mis

Flags:
-Ofast -march=native -g -std=legacy


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
[Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

[Bug fortran/86100] Spurious error with -fcheck=bounds and allocatable class(*) array components

2018-06-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86100

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-10
 Blocks||27766
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed from 6.4.0 up to trunk (9.0).


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27766
[Bug 27766] [meta-bug] -fbounds-check related bugs

[Bug fortran/64397] [OOP] Runtime segfault with parenthesis expression passed to polymorphic dummy argument

2018-06-10 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64397

Paul Thomas  changed:

   What|Removed |Added

 Status|WAITING |NEW
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #9 from Paul Thomas  ---
(In reply to Dominique d'Humieres from comment #8)
> AFAICT this PR is now fixed, likely r251949 (pr34640 and friends).

Well, for the original testcase, a=my_integer([1]) leaks memory.

If replaced with:
  integer :: i(1) = [1]
  a=my_integer(i)

the segfault at:
  c = (a)

returns.

It seems that there is a way to go on this one :-(

Reverting to NEW and taking.

Paul

[Bug fortran/64397] [OOP] Runtime segfault with parenthesis expression passed to polymorphic dummy argument

2018-06-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64397

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #10 from Dominique d'Humieres  ---
> Reverting to NEW and taking.

So ASSIGNED!-)

[Bug fortran/85599] Prevent short-circuiting of logical expressions for non-pure functions

2018-06-10 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85599

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #34 from Thomas Koenig  ---
I'll work on the warning.

[Bug fortran/68544] ICE trying to pass derived type constructor as a function

2018-06-10 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68544

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 CC||kargl at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org
   Severity|minor   |normal

[Bug tree-optimization/86101] [8/9 Regression] IEEE_UNDERFLOW_FLAG in 416.gamess with -Ofast -march=native on bdver4

2018-06-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86101

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Andrew Pinski  ---
-fno-aggressive-loop-optimizations

*** This bug has been marked as a duplicate of bug 69368 ***

[Bug fortran/69368] [6 Regression] spec2006 test case 416.gamess fails with the g++ 6.0 compiler starting with r232508

2018-06-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69368

Andrew Pinski  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #96 from Andrew Pinski  ---
*** Bug 86101 has been marked as a duplicate of this bug. ***

[Bug middle-end/26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

2018-06-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
Bug 26163 depends on bug 86101, which changed state.

Bug 86101 Summary: [8/9 Regression] IEEE_UNDERFLOW_FLAG in 416.gamess with 
-Ofast -march=native on bdver4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86101

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c/86102] New: Include argument name in warning

2018-06-10 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86102

Bug ID: 86102
   Summary: Include argument name in warning
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jg at jguk dot org
  Target Milestone: ---

Could GCC list the parameter name please?

Current output
$ gcc -O2 -Wall -Wextra -Wpedantic -o main main.c
main.c: In function ‘main’:
main.c:9:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 3 has type ‘char *’ [-Wformat=]
 printf("result: %zu %zu %zu\n", value, "test", str);
^
main.c:9:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 4 has type ‘char *’ [-Wformat=]

Improved output:
$ gcc -O2 -Wall -Wextra -Wpedantic -o main main.c
main.c: In function ‘main’:
main.c:9:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 3 '"test"' has type ‘char *’ [-Wformat=]
 printf("result: %zu %zu %zu\n", value, "test", str);
^
main.c:9:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 4 'str' has type ‘char *’ [-Wformat=]


This example as a string-litteral (as I believe it is called) in arg 3, and a
char* pointer as arg 4.



//gcc -O2 -Wall -Wextra -Wpedantic -o main main.c

#include 

int main (void)
{
size_t value = 0;
char * str = "other";
printf("result: %zu %zu %zu\n", value, "test", str);

return 0;
}

[Bug c/86103] New: [9.0 Regression] ICE in in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86103

Bug ID: 86103
   Summary: [9.0 Regression] ICE in in get_string_length, at
tree-ssa-strlen.c:653
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

Created attachment 44256
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44256&action=edit
Reproducer for the ICE.

I get an ICE in get_string_length, at tree-sea-strlen.c:653. Possibly a
duplicate of PR86089. The code that triggers the error is attached. r260633
still worked, r261388. The problem appears on Darwin17.6.0, High Sierra 10.13.5
with Xcode 9.4. 
The ICE error message is:
$ gcc -DPACKAGE_NAME=\"WHIZARD\" -DPACKAGE_TARNAME=\"whizard\"
-DPACKAGE_VERSION=\"2.6.4\" "-DPACKAGE_STRING=\"WHIZARD 2.6.4\""
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"whizard\"
-DVERSION=\"2.6.4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
-DLT_OBJDIR=\".libs/\" -DHAVE_QUADMATH_H=1 -DHAVE_DLFCN_H=1 -I. -I../../mcfio
-g -O2 -MT mcf_ntuBldDbinc.lo -MD -MP -MF .deps/mcf_ntuBldDbinc.Tpo -c
mcf_ntuBldDbinc.c  -fno-common -DPIC -o .libs/mcf_ntuBldDbinc.o
during GIMPLE pass: strlen
mcf_ntuBldDbinc.c: In function 'mcf_ntubldRead':
mcf_ntuBldDbinc.c:475:6: internal compiler error: in get_string_length, at
tree-ssa-strlen.c:653
 void mcf_ntubldRead(char* fname)
  ^~
libbacktrace could not find executable to open

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

Jürgen Reuter  changed:

   What|Removed |Added

 CC||juergen.reuter at desy dot de

--- Comment #2 from Jürgen Reuter  ---
Possible duplicate: PR86103.

[Bug c/86102] Include argument name in warning

2018-06-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86102

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
This is a bad idea, trying to print arbitrary expressions results in them being
printed in whatever form the compiler has the expression at the point of the
warning, which is often different from what the user wrote.
The right thing is to print proper caret, and at least for me I'm getting
exactly that, I don't get what you printed, but instead:
gcc -S -Wall -W pr86102.c -O2
pr86102.c: In function ‘main’:
pr86102.c:7:27: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 3 has type ‘char *’ [-Wformat=]
 printf("result: %zu %zu %zu\n", value, "test", str);
 ~~^~~
 %s
pr86102.c:7:31: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 4 has type ‘char *’ [-Wformat=]
 printf("result: %zu %zu %zu\n", value, "test", str);
 ~~^~~~
 %s
and
g++ -S -Wall -W pr86102.C -O2
pr86102.C: In function ‘int main()’:
pr86102.C:6:18: warning: ISO C++ forbids converting a string constant to
‘char*’ [-Wwrite-strings]
 char * str = "other";
  ^~~
pr86102.C:7:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 3 has type ‘const char*’ [-Wformat=]
 printf("result: %zu %zu %zu\n", value, "test", str);
^~~ ~~
pr86102.C:7:12: warning: format ‘%zu’ expects argument of type ‘size_t’, but
argument 4 has type ‘char*’ [-Wformat=]

[Bug c/86102] Include argument name in warning

2018-06-10 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86102

--- Comment #2 from Jonny Grant  ---
My bad apologies, I pasted the wrong compiler output from older gcc

If I fix that const error in my sample, I get same output as you, with correct
carat.

Could I check - do you mean callnig a function like 

printf("result: %zu %zu %zu\n", value, "test", str);

There is no benefit from displaying 'value'  '"test"' or 'str' ?
Some functions might have 10 arguments.. much clearer to print the name of the
one that is bad I feel :)



: In function 'int main()':

:9:12: error: format '%zu' expects argument of type 'size_t', but
argument 3 has type 'const char*' [-Werror=format=]

 printf("result: %zu %zu %zu\n", value, "test", str);

^~~ ~~

:9:12: error: format '%zu' expects argument of type 'size_t', but
argument 4 has type 'const char*' [-Werror=format=]

cc1plus: all warnings being treated as errors

Compiler returned: 1


//gcc -O2 -Wall -Wextra -Wpedantic -o main main.c

#include 

int main (void)
{
size_t value = 0;
const char * str = "other";
printf("result: %zu %zu %zu\n", value, "test", str);

return 0;
}

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

--- Comment #3 from Jürgen Reuter  ---
I can definitely confirm this problem. Works with -O0 and -O1. Fails with -O2.

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

--- Comment #4 from Jürgen Reuter  ---
This is the dump-tree-original file, which is produced despite of the ICE, and
which is identical for -O1 and -O2:

;; Function __sputc (null)
;; enabled by -tree-original


{
  if ( --_p->_w >= 0 || _p->_w >= _p->_lbfsize && (signed char) _c != 10)
{
  return (int) (*_p->_p++  = (unsigned char) _c);
}
  else
{
  return __swbuf (_c, _p);
}
}


;; Function hoo (null)
;; enabled by -tree-original


{
  int slen;
  char file[32];

int slen;
char file[32];
  __builtin___strcpy_chk ((char *) &file, (const char *) in,
__builtin_object_size ((const void *) &file, 1));
  slen = (int) strlen ((const char *) &file);
  __builtin___sprintf_chk ((char *) &file + (sizetype) slen, 0,
__builtin_object_size ((const void *) &file + (sizetype) slen, 1), (const char
*) "1.out");
}

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

--- Comment #5 from Jürgen Reuter  ---
And this is the assembler code when executing -S -O1 (cf. below), while for the
-O2
version the compilation leads to an assembler file showing only the .text line:
.text
.globl _hoo
_hoo:
LFB1:
subq$40, %rsp
LCFI0:
movq%rdi, %rsi
movq%rsp, %rdi
movl$32, %edx
call___strcpy_chk
addq$40, %rsp
LCFI1:
ret
LFE1:
.section
__TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
EH_frame1:
.set L$set$0,LECIE1-LSCIE1
.long L$set$0
LSCIE1:
.long   0
.byte   0x1
.ascii "zR\0"
.byte   0x1
.byte   0x78
.byte   0x10
.byte   0x1
.byte   0x10
.byte   0xc
.byte   0x7
.byte   0x8
.byte   0x90
.byte   0x1
.align 3
LECIE1:
LSFDE1:
.set L$set$1,LEFDE1-LASFDE1
.long L$set$1
LASFDE1:
.long   LASFDE1-EH_frame1
.quad   LFB1-.
.set L$set$2,LFE1-LFB1
.quad L$set$2
.byte   0
.byte   0x4
.set L$set$3,LCFI0-LFB1
.long L$set$3
.byte   0xe
.byte   0x30
.byte   0x4
.set L$set$4,LCFI1-LCFI0
.long L$set$4
.byte   0xe
.byte   0x8
.align 3
LEFDE1:
.subsections_via_symbols

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

Martin Sebor  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||marxin at gcc dot gnu.org

--- Comment #6 from Martin Sebor  ---
Thanks for the dump.  I can confirm the iCE with the simplified test case
below.  It's caused by a typo in r261304 in the hunk below.  The
BUILT_IN_STRCPY_CHK case needs to stay:

@@ -628,16 +617,8 @@ get_string_length (strinfo *si)
  lhs = NULL_TREE;
  /* FALLTHRU */
case BUILT_IN_STRCPY:
-   case BUILT_IN_STRCPY_CHK:
-   case BUILT_IN_STRCPY_CHKP:
-   case BUILT_IN_STRCPY_CHK_CHKP:
  gcc_assert (builtin_decl_implicit_p (BUILT_IN_STPCPY));
- if (gimple_call_num_args (stmt) == (with_bounds ? 4 : 2))
-   fn = builtin_decl_implicit (BUILT_IN_STPCPY);
- else
-   fn = builtin_decl_explicit (BUILT_IN_STPCPY_CHK);
- if (with_bounds)
-   fn = chkp_maybe_create_clone (fn)->decl;
+ fn = builtin_decl_implicit (BUILT_IN_STPCPY);
  gcc_assert (lhs == NULL_TREE);
  if (dump_file && (dump_flags & TDF_DETAILS) != 0)
{

$ cat pr86089.c && gcc -O2 -S -Wall pr86089.c
extern char* stpcpy (char*, const char*);

int f (char* s)
{
  char a[32];

  __builtin___strcpy_chk (a, s, __builtin_object_size (a, 1));

  return __builtin_strlen (a);
}
during GIMPLE pass: strlen
pr86089.c: In function ‘f’:
pr86089.c:3:5: internal compiler error: in get_string_length, at
tree-ssa-strlen.c:653
 int f (char* s)
 ^
0x1233bb5 get_string_length
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:653
0x1235343 handle_builtin_strlen
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:1190
0x123bd1c strlen_check_and_optimize_stmt
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3330
0x123d4b3 strlen_dom_walker::before_dom_children(basic_block_def*)
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3683
0x1b3cea3 dom_walker::walk(basic_block_def*)
/ssd/src/gcc/git-svn/gcc/domwalk.c:353
0x123d744 execute
/ssd/src/gcc/git-svn/gcc/tree-ssa-strlen.c:3763
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

--- Comment #7 from Jürgen Reuter  ---
Ah I see, so when Martin Liska removed the MPX-support in r261304 you removed
too much from the tree-ssa-strlen.c file? Then a rather fast fix is hopefully
possible.

[Bug tree-optimization/86083] handle non-constant assignments in strlen

2018-06-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86083

Martin Sebor  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-06-10
 Blocks||83819
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2018-06/msg00539.html


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83819
[Bug 83819] [meta-bug] missing strlen optimizations

[Bug fortran/67883] ICE on empty array constructor of character function

2018-06-10 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67883

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #0)
> With an effectively empty (i=m,n and m>n) array constructor :
> 
> 
> $ cat z1.f90
> program p
>integer i
>print *, [(f(i), i=2,1)]
> contains
>function f(n)
>   integer :: n
>   character(:), allocatable :: f
>   character(3) :: c = 'abc'
>   f = c(n:n)
>end
> end
> 
> 
> $ gfortran -g -O0 -Wall -fcheck=all -fno-frontend-optimize z1.f90
> z1.f90:3:25:
> 
> print *, [(f(i), i=2,1)]
>  1
> Warning: DO loop at (1) will be executed zero times [-Wzerotrip]
> f951: internal compiler error: in gfc_resolve_character_array_constructor,
> at fortran/array.c:1955

trunk can now compile this code.

[Bug fortran/67883] ICE on empty array constructor of character function

2018-06-10 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67883

--- Comment #5 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #2)
> Another group of examples.
> First case is working in a sufficient manner.
> Concatenating two empty hulls (zero len and size, respectivly)
> gives an empty hull as result again.
> 
> 
> $ cat zz1.f90
> program p
>character(*), parameter :: c1(*) = [character(*) :: 'a'] // [character(*)
> :: 'z']
>character(*), parameter :: c2(*) = [character(0) ::] // [character(0) ::]
>character(*), parameter :: c3(*) = [character(0) ::] // [character(*) ::]
>character(*), parameter :: c4(*) = [character(0) ::]
>print *, 'c1: ', len(c1), size(c1), c1
>print *, 'c2: ', len(c2), size(c2), c2
>print *, 'c3: ', len(c3), size(c3), c3
>print *, 'c4: ', len(c4), size(c4), c4
> end
> 

gfortran issues errors for this testcase.  Some are run-on errors.
I'm showing the first two as I think gfortran might be correct.

a.f90:2:39:

character(*), parameter :: c1(*) = [character(*) :: 'a'] // [character(*)
:: 'z']
   1
Error: Type-spec at (1) cannot contain an asterisk for a type parameter
a.f90:4:60:

character(*), parameter :: c3(*) = [character(0) ::] // [character(*) ::]
1

[Bug tree-optimization/86103] [9 Regression] ICE in in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86103

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
  Component|c   |tree-optimization
   Target Milestone|--- |9.0
Summary|[9.0 Regression] ICE in in  |[9 Regression] ICE in in
   |get_string_length, at   |get_string_length, at
   |tree-ssa-strlen.c:653   |tree-ssa-strlen.c:653

[Bug rtl-optimization/86104] New: gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant", at explow.c:103

2018-06-10 Thread helloqirun at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86104

Bug ID: 86104
   Summary: gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant",
at explow.c:103
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: helloqirun at gmail dot com
  Target Milestone: ---

It happens at 32-bit mode only.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180610 (experimental) [trunk revision 261387] (GCC)


$ gcc-trunk -m32 -O1 abc.c
during RTL pass: dse1
abc.c: In function ‘times_two’:
abc.c:16:1: internal compiler error: in plus_constant, at explow.c:103
 }
 ^
0x61289b plus_constant(machine_mode, rtx_def*, poly_int<1u, long>, bool)
../../gcc/gcc/explow.c:103
0x13e5e47 record_store
../../gcc/gcc/dse.c:1505
0x13e6a92 scan_insn
../../gcc/gcc/dse.c:2548
0x13e7912 dse_step1
../../gcc/gcc/dse.c:2660
0x13e7912 rest_of_handle_dse
../../gcc/gcc/dse.c:3577
0x13e7912 execute
../../gcc/gcc/dse.c:3635
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ cat abc.c
 int __RTL (startwith ("vregs")) times_two (int i)
{
(function ""
 (param "i"
  (DECL_RTL (mem(plus) [0  ]))
  (DECL_RTL_INCOMING (reg di ))
 ) (insn-chain
(block 2
 (edge-from entry )
 (cnote 4 [bb 2] NOTE_INSN_BASIC_BLOCK)
 (cinsn 2 (set (mem:SI (plus:DI (reg virtual-stack-vars)
(const_int 4)) [1 i+A32])
   (reg:SI di )) )
 (edge-to exit (flags "FALLTHRU"))
) ) )
}

[Bug c++/86105] New: Conversion to ambiguous/inaccessible rvalue base is valid in unevaluated context

2018-06-10 Thread johelegp at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86105

Bug ID: 86105
   Summary: Conversion to ambiguous/inaccessible rvalue base is
valid in unevaluated context
   Product: gcc
   Version: 8.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: johelegp at gmail dot com
  Target Milestone: ---

In the following snippet, the assertions fail although the `static_cast` is
ill-formed in non-unevaluated context. See https://godbolt.org/g/45VJvp, and a
related Clang report https://bugs.llvm.org/show_bug.cgi?id=37691.

```C++
#include 

template 
constexpr bool is_static_castable(...)
{
return false;
};

template <
class To, class From,
class = decltype(static_cast(std::declval()))>
constexpr bool is_static_castable(int)
{
return true;
};

struct B {
};

struct D : B {
};

struct D2
  : D
  , B {
};

static_assert(!is_static_castable(0), "");

struct D3 : private B {
};

static_assert(!is_static_castable(0), "");

void f()
{
D2 d2;
(void)static_cast(d2);
D3 d3;
(void)static_cast(d3);
}
```

[Bug c/61579] -Wwrite-strings does not behave as a warning option

2018-06-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61579

--- Comment #3 from Eric Gallager  ---
(In reply to Marek Polacek from comment #2)
> Confirmed.  I might possibly get to this.

For gcc 9 maybe?

[Bug tree-optimization/43432] Missed vectorization: "complicated access pattern" for increasing and decreasing data indexing

2018-06-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43432

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2018-06-11
 Ever confirmed|0   |1

--- Comment #5 from Eric Gallager  ---
(In reply to Eric Gallager from comment #4)
> (In reply to Michael Matz from comment #3)
> > Subject: Bug 43432
> > 
> > Author: matz
> > Date: Fri Sep 17 13:26:43 2010
> > New Revision: 164367
> > 
> > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164367
> > Log:
> > PR tree-optimization/43432
> > * tree-vect-data-refs.c (vect_analyze_data_ref_access):
> > Accept backwards consecutive accesses.
> > (vect_create_data_ref_ptr): If step is negative generate
> > decreasing IVs.
> > * tree-vect-stmts.c (vectorizable_store): Reject negative steps.
> > (perm_mask_for_reverse, reverse_vec_elements): New functions.
> > (vectorizable_load): Handle loads with negative steps when easily
> > possible.
> > 
> > testsuite/
> > PR tree-optimization/43432
> > * lib/target-supports.exp (check_effective_target_vect_perm_byte,
> > check_effective_target_vect_perm_short): New predicates.
> > (check_effective_target_vect_perm): Include x86_64.
> > * gcc.dg/vect/pr43432.c: New test.
> > * gcc.dg/vect/vect-114.c: Adjust.
> > * gcc.dg/vect/vect-15.c: Ditto.
> > * gcc.dg/vect/slp-perm-8.c: Use new predicate.
> > * gcc.dg/vect/slp-perm-9.c: Ditto.
> > 
> > Added:
> > trunk/gcc/testsuite/gcc.dg/vect/pr43432.c
> > Modified:
> > trunk/gcc/ChangeLog
> > trunk/gcc/testsuite/ChangeLog
> > trunk/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
> > trunk/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> > trunk/gcc/testsuite/gcc.dg/vect/vect-114.c
> > trunk/gcc/testsuite/gcc.dg/vect/vect-15.c
> > trunk/gcc/testsuite/lib/target-supports.exp
> > trunk/gcc/tree-vect-data-refs.c
> > trunk/gcc/tree-vect-stmts.c
> 
> Did this fix it?

Putting in WAITING on a reply

[Bug other/37210] Discourage Default Builds in the GCC Source Tree more strongly

2018-06-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37210

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-11
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=35619
 Ever confirmed|0   |1

--- Comment #7 from Eric Gallager  ---
(In reply to Eric Gallager from comment #6)
> I'm going to confirm this with a slightly modified title

Oops, I didn't actually confirm this when I said so; hopefully it'll do it this
time.

[Bug rtl-optimization/86104] gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant", at explow.c:103

2018-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86104

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-11
 CC||marxin at gcc dot gnu.org
Version|unknown |9.0
 Ever confirmed|0   |1
  Known to fail||7.3.0, 8.1.0, 9.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with __RTL was added: r244878.

[Bug rtl-optimization/86104] gcc ICE at -O1 on x86_64-linux-gnu in "plus_constant", at explow.c:103

2018-06-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86104

--- Comment #2 from Andrew Pinski  ---
Well DI is an invalid mode for mem address.  I don't know if __RTL support
should be considered a valid input at all or even consider all invalid input as
not iceing a valid bug.

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #8 from Martin Liška  ---
Sorry for the breakage. Thanks Martin for the analysis. Let me send a patch.

[Bug tree-optimization/86103] [9 Regression] ICE in in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86103

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||marxin at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #1 from Martin Liška  ---
Dup.

*** This bug has been marked as a duplicate of bug 86089 ***

[Bug tree-optimization/86089] [9 Regression] ICE in get_string_length, at tree-ssa-strlen.c:653

2018-06-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86089

--- Comment #9 from Martin Liška  ---
*** Bug 86103 has been marked as a duplicate of this bug. ***