[Bug c/83117] [8 Regression] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-25 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

--- Comment #7 from rguenther at suse dot de  ---
On November 26, 2017 8:07:10 AM GMT+01:00, "jakub at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117
>
>--- Comment #6 from Jakub Jelinek  ---
>The warning is nothing new, GCC has been warning for that for years. 
>What my
>patch did is just better optimization, so the compiler can see the UB.
>
>Try:
>extern long do_test_aligned ();
>
>static long (*const do_test_v1) (long a, ...) = (void *)
>do_test_aligned;
>
>extern void check_results (long);
>
>int test (long a)
>{
>  long ret;
>
>  ret = do_test_v1 (a);
>  ret += (long (*) (long a, ...)) do_test_aligned;
>  check_results (ret);
>}
>
>We've warned about the latter, but not the former, since we weren't
>able to
>fold a const var to its initializer.
>
>So, either the tests shouldn't use const on these, something like:
>-  out << "static __attribute__ ((ms_abi)) long (*const
>do_test_"
>+  out << "static __attribute__ ((ms_abi)) long (*do_test_"
>or they should use const volatile, or -w, or should use proper
>prototypes.
>
>Daniel needs to decide what to do, it isn't obviously clear what the
>intent is.

The intent of the test was probably to force an indirect call.

[Bug c/83117] [8 Regression] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

--- Comment #6 from Jakub Jelinek  ---
The warning is nothing new, GCC has been warning for that for years.  What my
patch did is just better optimization, so the compiler can see the UB.

Try:
extern long do_test_aligned ();

static long (*const do_test_v1) (long a, ...) = (void *) do_test_aligned;

extern void check_results (long);

int test (long a)
{
  long ret;

  ret = do_test_v1 (a);
  ret += (long (*) (long a, ...)) do_test_aligned;
  check_results (ret);
}

We've warned about the latter, but not the former, since we weren't able to
fold a const var to its initializer.

So, either the tests shouldn't use const on these, something like:
-  out << "static __attribute__ ((ms_abi)) long (*const do_test_"
+  out << "static __attribute__ ((ms_abi)) long (*do_test_"
or they should use const volatile, or -w, or should use proper prototypes.

Daniel needs to decide what to do, it isn't obviously clear what the intent is.

[Bug c++/83165] [8 regression] cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in return

2017-11-25 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #4 from Markus Trippelsdorf  ---
The error is correct. Not a bug.

[Bug c/81851] missing -Wduplicated-branches on if and return statements with no else

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81851

Martin Sebor  changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #4 from Martin Sebor  ---
There is no difference between functions f() and g() in comment #0.  The source
code in both is equivalent (and the latter is frequently preferred to the
former) and the emitted object code is identical.  So irrespective of whether
or not both were considered in the implementation of the warning, I can't think
of a justification for diagnosing only one and not the other that would be
helpful to users.  (If there is one, what is it?)

[Bug testsuite/83155] [8 regression] test-error-array-bounds.c.exe fail

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83155

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
  Component|jit |testsuite
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=64296,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=67137,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83163
   Assignee|dmalcolm at gcc dot gnu.org|unassigned at gcc dot 
gnu.org

--- Comment #2 from Martin Sebor  ---
Thanks for fixing it, David.  I don't normally build jit, in part because
--enable-languages=all doesn't enable it, but mainly because of
pr67137/pr64296, so I missed this failure.  I tried to see if I could get past
the bootstrap problems mentioned there but ran into pr83163.  Not sure what's
going on there but I think this bug can be resolved as fixed.

[Bug c++/83165] [8 regression] cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in return

2017-11-25 Thread skpgkp1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

--- Comment #3 from Sunil Pandey  ---
Well, this is creduce generated code from clipsmm application build file.

https://sourceforge.net/projects/clipsmm/

If you want, I can attach original preprocessed file.

[Bug c++/83165] [8 regression] cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in return

2017-11-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

--- Comment #2 from Andrew Pinski  ---
Note since GPrivate is non dependent type checking can happen at defintion time
rather than instaination time.

[Bug c++/83165] [8 regression] cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in return

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

--- Comment #1 from Marc Glisse  ---
Could you explain why this code should be accepted, to save time?

[Bug c++/83166] [8 regression] error: type mismatch in pointer diff expression internal compiler error: verify_gimple failed

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83166

Marc Glisse  changed:

   What|Removed |Added

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

--- Comment #1 from Marc Glisse  ---
dup.

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

[Bug middle-end/83164] [8 regression] internal compiler error: verify_gimple failed

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83164

Marc Glisse  changed:

   What|Removed |Added

 CC||skpgkp1 at gmail dot com

--- Comment #3 from Marc Glisse  ---
*** Bug 83166 has been marked as a duplicate of this bug. ***

[Bug middle-end/83164] [8 regression] internal compiler error: verify_gimple failed

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83164

--- Comment #2 from Marc Glisse  ---
Does it work if you remove the verification

|| !types_compatible_p (rhs1_type, rhs2_type)

from tree-cfg.c?

useless_type_conversion_p says that converting a function pointer to char* is
useless (but the reverse isn't), so we can't guarantee types_compatible_p.

[Bug c++/83166] New: [8 regression] error: type mismatch in pointer diff expression internal compiler error: verify_gimple failed

2017-11-25 Thread skpgkp1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83166

Bug ID: 83166
   Summary: [8 regression] error: type mismatch in pointer diff
expression internal compiler error: verify_gimple
failed
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

This issue appear in dmtcp build with GCC 8.0. GCC 7.2.1 works fine.

$ cat mtcp_restart.i.c
char a;
b() { long c = (char *)b -  }

### Fail with GCC 8.0

$gcc --version
gcc (GCC) 8.0.0 20171124 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$gcc -g -O2 -c  -o mtcp_restart.i.c.o -fPIC -fno-stack-protector -g -O0
mtcp_restart.i.c
mtcp_restart.i.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 b() { long c = (char *)b -  }
 ^
mtcp_restart.i.c: In function ‘b’:
mtcp_restart.i.c:2:1: error: type mismatch in pointer diff expression
long int

int (*) ()

char *

c = b - 
mtcp_restart.i.c:2:1: internal compiler error: verify_gimple failed
0xd4a52d verify_gimple_in_seq(gimple*)
../../gcc-main.3O1G/gcc/tree-cfg.c:5094
0xb00bdd gimplify_body(tree_node*, bool)
../../gcc-main.3O1G/gcc/gimplify.c:12606
0xb00dc4 gimplify_function_tree(tree_node*)
../../gcc-main.3O1G/gcc/gimplify.c:12696
0x998d47 cgraph_node::analyze()
../../gcc-main.3O1G/gcc/cgraphunit.c:670
0x99b835 analyze_functions
../../gcc-main.3O1G/gcc/cgraphunit.c:1131
0x99c412 symbol_table::finalize_compilation_unit()
../../gcc-main.3O1G/gcc/cgraphunit.c:2690
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

### Pass with GCC 7.2.1

$gcc --version
gcc (GCC) 7.2.1 20171124
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$gcc -g -O2 -c  -o mtcp_restart.i.c.o -fPIC -fno-stack-protector -g -O0
mtcp_restart.i.c
mtcp_restart.i.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 b() { long c = (char *)b -  }
 ^
$ echo $?
0

[Bug c++/83165] New: [8 regression] cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in return

2017-11-25 Thread skpgkp1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83165

Bug ID: 83165
   Summary: [8 regression] cannot convert ‘GPrivate’ {aka
‘_GPrivate’} to ‘GPrivate*’ {aka ‘_GPrivate*’} in
return
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

This issue appear in clipsmm build with gcc 8. gcc 7.2.1 build work fine.

$ cat environment.i.cpp
typedef struct _GPrivate GPrivate;
struct _GPrivate {};
template  class a {
  GPrivate *b() { return c; }
  GPrivate c;
};


### Fail with GCC 8.0

$g++ --version
g++ (GCC) 8.0.0 20171124 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -pthread -g -O2 -std=c++0x  -c environment.i.cpp  -fPIC  -o
environment.i.cpp.o
environment.i.cpp: In member function ‘GPrivate* a< 
>::b()’:
environment.i.cpp:4:26: error: cannot convert ‘GPrivate’ {aka ‘_GPrivate’} to
‘GPrivate*’ {aka ‘_GPrivate*’} in return
   GPrivate *b() { return c; }
  ^
### Pass with GCC 7.2.1

$g++ --version
g++ (GCC) 7.2.1 20171124
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++ -pthread -g -O2 -std=c++0x  -c environment.i.cpp  -fPIC  -o
environment.i.cpp.o
$ echo $?
0

[Bug middle-end/83164] [8 regression] internal compiler error: verify_gimple failed

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83164

Marc Glisse  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-26
 Ever confirmed|0   |1

--- Comment #1 from Marc Glisse  ---
void b() { long a = (char *)b - (char *)1; }


ddeml.i: In function 'b':
ddeml.i:1:6: error: type mismatch in pointer diff expression
 void b() { long a = (char *)b - (char *)1; }
  ^
long int

void (*) ()

char *

a = b - 1B;
ddeml.i:1:6: internal compiler error: verify_gimple failed
0xdafba4 verify_gimple_in_seq(gimple*)
/home/glisse/repos/gcc/trunk/gcc/tree-cfg.c:5094
0xb534ae gimplify_body(tree_node*, bool)
/home/glisse/repos/gcc/trunk/gcc/gimplify.c:12606
0xb5369d gimplify_function_tree(tree_node*)
/home/glisse/repos/gcc/trunk/gcc/gimplify.c:12696
0x9ddb4f cgraph_node::analyze()
/home/glisse/repos/gcc/trunk/gcc/cgraphunit.c:670
0x9e0765 analyze_functions
/home/glisse/repos/gcc/trunk/gcc/cgraphunit.c:1131
0x9e1432 symbol_table::finalize_compilation_unit()
/home/glisse/repos/gcc/trunk/gcc/cgraphunit.c:2690

[Bug middle-end/83164] New: [8 regression] internal compiler error: verify_gimple failed

2017-11-25 Thread gerald at pfeifer dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83164

Bug ID: 83164
   Summary: [8 regression] internal compiler error: verify_gimple
failed
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerald at pfeifer dot com
CC: marc.glisse at normalesup dot org
  Target Milestone: ---
  Host: i586-unknown-freebsd10.4

Created attachment 42718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42718=edit
Preprocessed source file

This one's easy to reproduce, no specific compiler options are required:

% $GCC -c -o ddeml.o ddeml.i
ddeml.c: In function ‘DDEML_AddThunk’:
ddeml.c:181:28: error: type mismatch in pointer diff expression
 static struct ddeml_thunk*  DDEML_AddThunk(DWORD instId, DWORD pfn16)
^~
int

struct HDDEDATA__ * (*) (DWORD, UINT, UINT, struct HCONV__ *, struct
HSZ__ *, struct HSZ__ *, struct HDDEDATA__ *, ULONG_PTR, ULONG_PTR)

DWORD *

_6 = WDML_InvokeCallback16 - _5;
ddeml.c:181:28: internal compiler error: verify_gimple failed



Also the diagnostics look quite odd, don't they?


I believe this was introduced by the following?

2017-10-28  Marc Glisse  

gcc/c/
* c-fold.c (c_fully_fold_internal): Handle POINTER_DIFF_EXPR.
* c-typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.

gcc/c-family/
* c-pretty-print.c (pp_c_additive_expression,
c_pretty_printer::expression): Handle POINTER_DIFF_EXPR.

gcc/cp/
* constexpr.c (cxx_eval_constant_expression,
potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
* cp-gimplify.c (cp_fold): Likewise.
* error.c (dump_expr): Likewise.
* typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.

[Bug tree-optimization/80776] -Wformat-overflow false positive for %d on integer bounded by __builtin_unreachable

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80776

--- Comment #3 from Paul Eggert  ---
(In reply to Richard Biener from comment #1)
> Possibly the walk in remove_range_assertions visits the latter before the
> former block but in principle we do have code to handle this there.

I just ran into the same problem again, with the following code derived from
GNU Emacs, and it suggests that your diagnosis is correct. Perhaps this can be
used in a test case once the bug is fixed. If I remove the "if (! (0 <= i))
__builtin_unreachable ();" the bogus warning goes away, which suggests that the
earlier test is hiding the later one somehow. This is with GCC 7.2.1 20170915
(Red Hat 7.2.1-2) on x86-64.

extern __inline __attribute__ ((__always_inline__)) __attribute__
((__gnu_inline__)) __attribute__ ((__artificial__)) int
__attribute__ ((__nothrow__ , __leaf__)) sprintf (char *__restrict __s, const
char *__restrict __fmt, ...)
{
  return __builtin___sprintf_chk (__s, 2 - 1,
  __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
}
char number[sizeof "99"];
int somerandom (void);
void
Foo (void)
{
  int i = somerandom ();
  if (! (0 <= i))
__builtin_unreachable ();
  if (! (0 <= i && i <= 99))
__builtin_unreachable ();
  sprintf (number, "%d", i);
}

$ gcc -Wformat-overflow -O2 -S v.i
v.i: In function ‘Foo’:
v.i:17:21: warning: ‘%d’ directive writing between 1 and 10 bytes into a region
of size 7 [-Wformat-overflow=]
   sprintf (number, "%d", i);
 ^~
v.i:17:20: note: directive argument in the range [0, 2147483647]
   sprintf (number, "%d", i);
^~~~
v.i:4:10: note: ‘__builtin___sprintf_chk’ output between 2 and 11 bytes into a
destination of size 7
   return __builtin___sprintf_chk (__s, 2 - 1,
  ^~~~
   __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
   

[Bug rtl-optimization/81553] [7 Regression] ICE in immed_wide_int_const, at emit-rtl.c:607

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81553

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8 Regression] ICE in |[7 Regression] ICE in
   |immed_wide_int_const, at|immed_wide_int_const, at
   |emit-rtl.c:607  |emit-rtl.c:607

--- Comment #4 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug middle-end/61118] [6/7/8 Regression] Indirect call generated for pthread_cleanup_push with constant cleanup function

2017-11-25 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=54561,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83162

--- Comment #15 from Eric Gallager  ---
(In reply to Paul Eggert from comment #14)
> Also please see related reports Bug 21161, Bug 48968, Bug 54561, Bug 65041,
> and Bug 83162. The last-listed one also is a regression, perhaps induced by
> the fancier optimization in recent GCC versions. I suspect that the bugs
> should be merged.

I can merge them once we choose which of them to use as the base bug.

[Bug middle-end/48968] incorrect warning about longjmp/vfork clobbering a local (-W -O2, x86-64)

2017-11-25 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48968

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=54561,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=83162

--- Comment #12 from Eric Gallager  ---
(In reply to Paul Eggert from comment #11)
> Also please see related bugs Bug 21161, Bug 54561, Bug 61118, Bug 65041, Bug
> 83162. Perhaps they should be merged?

Sure, but into which one?

[Bug bootstrap/83163] New: bootstrap comparison failure with --enable-languages=all,jit

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83163

Bug ID: 83163
   Summary: bootstrap comparison failure with
--enable-languages=all,jit
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Today's top of trunk (GCC 8.0) fails to bootstrap fails with the error below
when configured with --enable-languages=all,jit --enable-host-shared
--enable-checking=release

make[3]: Leaving directory '/opt/notnfs/msebor/build/gcc-git'
Comparing stages 2 and 3
warning: gcc/cc1objplus-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
Bootstrap comparison failure!
gcc/combine.o differs
Makefile:27134: recipe for target 'compare' failed
make[2]: *** [compare] Error 1
make[2]: Leaving directory '/opt/notnfs/msebor/build/gcc-git'
Makefile:27113: recipe for target 'stage3-bubble' failed
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory '/opt/notnfs/msebor/build/gcc-git'
Makefile:27176: recipe for target 'bootstrap' failed
make: *** [bootstrap] Error 2
make: Leaving directory '/opt/notnfs/msebor/build/gcc-git'

[Bug target/83156] [8 regression] gcc.target/i386/pr82361-1.c fail

2017-11-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83156

--- Comment #3 from Segher Boessenkool  ---
Hrm, looking for a REG_UNUSED of the dests (instead of of anything)
fixes f1 and f2, but not the rest.

[Bug target/83156] [8 regression] gcc.target/i386/pr82361-1.c fail

2017-11-25 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83156

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-11-25
   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Segher Boessenkool  ---
Ah, I see what is happening -- there are REG_UNUSED notes here that do
not refer to a SET (to a CLOBBER, instead).  Shouldn't be hard to fix :-)

[Bug jit/64296] link failure of libgccjit.so for "in tree" gmp/mpc/mpfr/isl

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64296

Martin Sebor  changed:

   What|Removed |Added

   Keywords||build
  Known to fail|6.0 |6.4.0, 7.2.0, 8.0

--- Comment #7 from Martin Sebor  ---
No change since 6.0.

[Bug bootstrap/67137] --enable-languages=jit and --disable-shared

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67137

Martin Sebor  changed:

   What|Removed |Added

   Keywords||build
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1
  Known to fail||6.4.0, 7.2.0, 8.0

--- Comment #2 from Martin Sebor  ---
Confirmed with today's top of trunk (GCC 8.0).  No change since 6.0.

[Bug rtl-optimization/81553] [7/8 Regression] ICE in immed_wide_int_const, at emit-rtl.c:607

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81553

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Sat Nov 25 19:35:47 2017
New Revision: 255150

URL: https://gcc.gnu.org/viewcvs?rev=255150=gcc=rev
Log:
PR rtl-optimization/81553
* combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z)
to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP
is a shift where C1 has different mode than the whole shift, use C1's
mode for MULT rather than the shift's mode.

* gcc.c-torture/compile/pr81553.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr81553.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/82488] UBSAN in gcc/expr.c:4098:17: runtime error: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long int'

2017-11-25 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82488

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #2 from Markus Trippelsdorf  ---
diff --git a/gcc/expr.c b/gcc/expr.c
index ee07de5aaa44..e9d8555c9452 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4100,10 +4100,13 @@ fixup_args_size_notes (rtx_insn *prev, rtx_insn *last,
int end_args_size)
   if (STACK_GROWS_DOWNWARD)
this_delta = -(unsigned HOST_WIDE_INT) this_delta;

-  args_size -= this_delta;
+  if (saw_unknown)
+   args_size = INT_MIN;
+  else
+   args_size -= this_delta;
 }

-  return saw_unknown ? INT_MIN : args_size;
+  return args_size;
 }

 #ifdef PUSH_ROUNDING

[Bug fortran/83152] Possible run time error in derived type i/o

2017-11-25 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83152

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #2 from Jerry DeLisle  ---
By my count, you are off by one character in one of your field widths. Add a
space at the end of the lines in the input file or change format to

person_format='(a,2x,i3,2x,f4.2,1x,f3.0)'

1x, not 2x toward the end. (or maybe add a decimal point at end of lines in
input file)

I get with 1x:

$ ./a.out 
Zahpod Beeblebrox42  1.85  75.
Ford Prefect 25  1.75  65.
Arthur Dent  30  1.72  68.
Trillian 30  1.65  45.

[Bug c/83117] [8 Regression] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

--- Comment #5 from Martin Sebor  ---
C requires that every function must be declared and called by [an expression
of] a compatible type and specifies special rules for the ellipsis and for
functions without a prototype.

For two function types to be compatible, ... If one type has a parameter type
list and the other type is specified by a function declarator that is not part
of a function definition and that contains an empty identifier list, the
parameter list shall not have an ellipsis terminator.

In the snippet in comment #2:

  extern long do_test_aligned ();

  static long (*const do_test_v1) (long a, ...) = (void *) do_test_aligned;

  do_test_v1 (a);

do_test_aligned has an empty identifier list and do_test_v1's parameter list
ends in an ellipsis, making the two incompatible.  So either the call is
undefined or the two declarations of do_test_aligned, one without a prototype
and one with (matching do_test_v1, in some other translation unit), are
undefined.

I don't know if GCC supports any targets where this incompatibility is, in
fact, undefined.  If not, then perhaps the warning in this specific case should
only be issued with -Wpedantic.

In any event, I think the warning should have an option controlling it.

The phrasing could also be improved: both the established term and the
preferred English word is "incompatible" (not "non-compatible").

[Bug c++/83161] Feature request: add a builtin for printing structs and classes

2017-11-25 Thread Hi-Angel at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83161

--- Comment #1 from Constantine Kharlamov  ---
Just another data point I forgot to mention:
https://stackoverflow.com/questions/3311182/linux-c-easy-pretty-dump-printout-of-structs-like-in-gdb-from-source-co
7k views. Author of this one went as far as implementing a hack with firing up
gdb from the code, getting the representation of a struct from there to a
buffer, then printing the buffer. It didn't help very much to the OP though,
because they wanted the like for kernel module.

[Bug middle-end/61118] [6/7/8 Regression] Indirect call generated for pthread_cleanup_push with constant cleanup function

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118

--- Comment #14 from Paul Eggert  ---
Also please see related reports Bug 21161, Bug 48968, Bug 54561, Bug 65041, and
Bug 83162. The last-listed one also is a regression, perhaps induced by the
fancier optimization in recent GCC versions. I suspect that the bugs should be
merged.

[Bug middle-end/48968] incorrect warning about longjmp/vfork clobbering a local (-W -O2, x86-64)

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48968

--- Comment #11 from Paul Eggert  ---
Also please see related bugs Bug 21161, Bug 54561, Bug 61118, Bug 65041, Bug
83162. Perhaps they should be merged?

[Bug c++/83161] Feature request: add a builtin for printing structs and classes

2017-11-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83161

Andrew Pinski  changed:

   What|Removed |Added

  Component|other   |c++
   Severity|normal  |enhancement

[Bug middle-end/21161] "clobbered by longjmp" warning ignores the data flow

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21161

Paul Eggert  changed:

   What|Removed |Added

 CC||eggert at gnu dot org

--- Comment #5 from Paul Eggert  ---
Also please see Bug 48968, Bug 54561, Bug 61118, Bug 65041, and Bug 83162,
which all seem to be related to this one.

[Bug middle-end/65041] Improve -Wclobbered

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65041

--- Comment #4 from Paul Eggert  ---
Also please see Bug 83162, which may be related.

[Bug c/83162] New: x86-64 -Wclobbered issuing more false alarms (regression)

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83162

Bug ID: 83162
   Summary: x86-64 -Wclobbered issuing more false alarms
(regression)
   Product: gcc
   Version: 7.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eggert at gnu dot org
  Target Milestone: ---

Created attachment 42717
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42717=edit
Test case for "gcc -O2 -S -Wclobbered" on x86-64

When building GNU Emacs we're finding that -Wclobbered is now issuing so many
false alarms that I think we will turn it off in more modules. I ran into this
problem again today, and narrowed it down to the attached program simplified
from Emacs. Compile and run it with:

gcc -O2 -S -Wclobbered clobbered.c

and GCC outputs:

clobbered.c: In function ‘module_vec_set’:
clobbered.c:22:29: warning: argument ‘vec’ might be clobbered by ‘longjmp’ or
‘vfork’ [-Wclobbered]
 module_vec_set (Lisp_Object vec, long i, Lisp_Object val)
 ^~~
clobbered.c:22:54: warning: argument ‘val’ might be clobbered by ‘longjmp’ or
‘vfork’ [-Wclobbered]
 module_vec_set (Lisp_Object vec, long i, Lisp_Object val)
  ^~~

Both diagnostics are bogus, since _setjmp's caller immediately returns if
_setjmp returns nonzero.

I am using gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) on x86-64. I do not
observe the problem with gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), so it is
a regression.

Also see Bug 21161, Bug 48968, Bug 54561, Bug 61118, and Bug 65041. This
particular test case appears to be new though, as it is a regression.

[Bug other/83161] New: Feature request: add a builtin for printing structs and classes

2017-11-25 Thread Hi-Angel at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83161

Bug ID: 83161
   Summary: Feature request: add a builtin for printing structs
and classes
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: Hi-Angel at yandex dot ru
  Target Milestone: ---

It's very useful for debugging to pretty-print an entire struct. Typically
people firing up gdb for this, but sometimes it's hard, like on embedded
systems; and always is time-consuming.

This issue is popular enough that e.g. the new systems language Rust have this
functionality built-in.

Some relevant questions to show demand:
1. "Printing values of all fields in a C++ structure"
https://stackoverflow.com/questions/2758937/printing-values-of-all-fields-in-a-c-structure
22k views.
2. Someone attempting the same thing for linux kernel
https://stackoverflow.com/questions/14572015/how-to-print-to-screen-a-struct-and-all-its-content
4k views.

Prior art: Haskell language have a very simple implementation: adding after
declaration of a type "derive Show" generates a code for returning a string
with human-readable description of its object. And if a programmer wants to
tweak representation of a specific type, they override "show" function.

So, I imagine a function "_gcc_show()", and 2 attributes — one to generate a
code for a struct/class, another to override a "_gcc_show()" for certain type —
would be more than enough.

[Bug middle-end/70773] Profiled sudoku solver slower due to lack of sdiv/udiv

2017-11-25 Thread tulipawn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70773

--- Comment #22 from PeteVine  ---
> I don't know what exactly "fixed" this

That would be nice to know. This I can say for sure: gcc 7.2.1 20171116 still
produces slower profiled code on the target system. 

I've also discovered, compiling and profiling on a binary compatible Cortex A17
system (same flags), produces binaries that don't run any slower on the target
system.

[Bug libgomp/83159] [8 regression] g++.dg/gomp/declare-simd-1.C fail

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83159

--- Comment #1 from Jakub Jelinek  ---
r255117 should have fixed this already.

[Bug c++/83160] New: [8 regression] lvalue required as unary ‘&’ operand

2017-11-25 Thread skpgkp1 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83160

Bug ID: 83160
   Summary: [8 regression] lvalue required as unary ‘&’ operand
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: skpgkp1 at gmail dot com
  Target Milestone: ---

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

This issue appear in HHVM build with GCC 8. GCC 7.2.1 works fine with attached
test case.

$ cat File.i.cpp
namespace a {
template  void ac(b, const b &);
}
int ag;
class c {
  c();
};
template  class C;
C ak();
template  class d {
public:
  template  void operator()(an &) const;
  template  void e(ao) {
auto appender = [] {};
(*this)(appender);
  }
  void f() { e(ag); }
};
template  class C : public d {};
template 
template 
void d::operator()(an &) const {
  constexpr int bj = 8;
  [](int bk) { a::ac(bk, bj); };
}
c::c() { ak().f(); }

### Fail with GCC 8.0

$g++ --version
g++ (GCC) 8.0.0 20171124 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -ffunction-sections -fno-delete-null-pointer-checks  -std=gnu++1y
-fno-omit-frame-pointer -fno-operator-names -fdata-sections -fno-gcse
-fno-canonical-system-headers -mcrc32 -O3 --param max-inline-insns-auto=100
--param early-inlining-insns=200 --param max-early-inliner-iterations=50
--param=inline-unit-growth=200 --param=large-unit-insns=1
-momit-leaf-frame-pointer -Wall -Wextra  -o File.i.cpp.o -c File.i.cpp -Wall
-Wextra
File.i.cpp: In instantiation of ‘void d< , ,
 >::operator()(an&) const [with an = d<
, ,  >::e(ao) [with
ao = int;  = int; bool  = true;
 = {}]::;  = int;
bool  = true;  = {}]’:
File.i.cpp:15:12:   required from ‘void d< ,
,  >::e(ao) [with ao = int;
 = int; bool  = true;
 = {}]’
File.i.cpp:17:14:   required from ‘void d< ,
,  >::f() [with  =
int; bool  = true;  = {}]’
File.i.cpp:26:17:   required from here
File.i.cpp:24:21: error: lvalue required as unary ‘&’ operand
   [](int bk) { a::ac(bk, bj); };
~^~~~



### Pass with GCC 7.2.1

$g++ --version
g++ (GCC) 7.2.1 20171124
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$g++  -ffunction-sections -fno-delete-null-pointer-checks  -std=gnu++1y
-fno-omit-frame-pointer -fno-operator-names -fdata-sections -fno-gcse
-fno-canonical-system-headers -mcrc32 -O3 --param max-inline-insns-auto=100
--param early-inlining-insns=200 --param max-early-inliner-iterations=50
--param=inline-unit-growth=200 --param=large-unit-insns=1
-momit-leaf-frame-pointer -Wall -Wextra  -o File.i.cpp.o -c File.i.cpp -Wall
-Wextra
$ echo $?
0

[Bug jit/83155] [8 regression] test-error-array-bounds.c.exe fail

2017-11-25 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83155

--- Comment #1 from David Malcolm  ---
I believe I fixed this in r255082.

[Bug fortran/83153] Possible run time error in derived type io example - 2

2017-11-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83153

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed. Likely a duplicate of pr83152.

[Bug fortran/83152] Possible run time error in derived type i/o

2017-11-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83152

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed.

[Bug libgomp/83159] New: [8 regression] g++.dg/gomp/declare-simd-1.C fail

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83159

Bug ID: 83159
   Summary: [8 regression] g++.dg/gomp/declare-simd-1.C fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgomp
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
CC: jakub at gcc dot gnu.org
  Target Milestone: ---

r255018 triggers this:

spawn -ignore SIGHUP /work/gcc/testsuite/g++7/../../xg++
-B/work/gcc/testsuite/g++7/../../
/source/gcc/testsuite/g++.dg/gomp/declare-simd-1.C -fno-diagnostics-show-caret
-fdiagnostics-color=never -nostdinc++
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include
-I/source/libstdc++-v3/libsupc++ -I/source/libstdc++-v3/include/backward
-I/source/libstdc++-v3/testsuite/util -fmessage-length=0 -std=gnu++98 -fopenmp
-ffat-lto-objects -S -o declare-simd-1.s
FAIL: g++.dg/gomp/declare-simd-1.C  -std=gnu++98 (test for excess errors)

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

[Bug target/83158] [8 regression] gcc.target/i386/pr78057.c fail

2017-11-25 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83158

Marc Glisse  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1

--- Comment #1 from Marc Glisse  ---
It is related to PR 83073 but not quite a dup, it looks like another case where
we have more information than we can store in a range, and choose a subset that
hurts in this testcase. The opposite choice would hurt a different testcase,
the issue is finding a reasonable heuristic (say give priority to excluding 0
from the range for instance). The (longer term) plans to have 2+-component
ranges would also help.

[Bug target/83158] New: [8 regression] gcc.target/i386/pr78057.c fail

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83158

Bug ID: 83158
   Summary: [8 regression] gcc.target/i386/pr78057.c fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
  Target Milestone: ---

r254954 triggers this:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/gcc.target/i386/pr78057.c
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxrt
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxrt/.libs
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap/.libs -fno-diagnostics-show-caret
-fdiagnostics-color=never -O2 -mbmi -mlzcnt -fdump-tree-optimized -S -o
pr78057.s
PASS: gcc.target/i386/pr78057.c (test for excess errors)
PASS: gcc.target/i386/pr78057.c scan-tree-dump-not optimized "link_error"
FAIL: gcc.target/i386/pr78057.c scan-tree-dump-not optimized
"__builtin_ia32_[lt]zcnt"

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

Not sure whether this is a dupe of either pr83072 or pr83073.

[Bug target/78553] GCC 5.3.0 and 5.4.0 segfault during bootstrap when --enable-vtable-verify is enabled on PowerPC musl

2017-11-25 Thread slyfox at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78553

Sergei Trofimovich  changed:

   What|Removed |Added

 CC||slyfox at inbox dot ru

--- Comment #1 from Sergei Trofimovich  ---
Also seems to happen on powerpc64-unknown-linux-gnu

[sf]
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/powerpc64-unknown-linux-gnu/libstdc++-v3/src:gdb
--args
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/./gcc/cc1plus
-quiet -nostdinc++ -v -I
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/powerpc64-unknown-linux-gnu/libstdc++-v3/include/powerpc64-unknown-linux-gnu
-I
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/powerpc64-unknown-linux-gnu/libstdc++-v3/include
-I
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/gcc-7.2.0/libstdc++-v3/libsupc++
-iprefix
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/gcc/../../../../lib/gcc/powerpc64-unknown-linux-gnu/7.2.0/
-isystem
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/./gcc/include
-isystem
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/./gcc/include-fixed
-D_GNU_SOURCE -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux
-D__linux -Asystem=linux -Asystem=unix -Asystem=posix -D PIC -D _GNU_SOURCE -D
PIC -D _GLIBCXX_SHARED -isystem /usr/powerpc64-unknown-linux-gnu/include
-isystem /usr/powerpc64-unknown-linux-gnu/sys-include
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/gcc-7.2.0/libstdc++-v3/src/c++98/compatibility.cc
-msecure-plt -fstack-check -quiet -dumpbase compatibility.cc -auxbase-strip
.libs/compatibility.o -g -O2 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-std=gnu++98 -version -fno-implicit-templates -fvtable-verify=std
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=compatibility.lo -fPIC -o /tmp/ccKqbE0M.s


Program received signal SIGSEGV, Segmentation fault.
0x00889de8 in symtab_node::ultimate_alias_target(availability*,
symtab_node*) ()
(gdb) bt
#0  0x00889de8 in symtab_node::ultimate_alias_target(availability*,
symtab_node*) ()
#1  0x00a47d05 in cgraph_node::ultimate_alias_target(availability*,
symtab_node*) ()
#2  0x012b9d27 in call_ABI_of_interest(tree_node*) ()
#3  0x012b9fee in init_cumulative_args(rs6000_args*, tree_node*,
rtx_def*, int, int, int, tree_node*, machine_mode) ()
#4  0x009ed43b in expand_call(tree_node*, rtx_def*, int) ()
#5  0x00b5a63a in expand_expr_real_1(tree_node*, rtx_def*,
machine_mode, expand_modifier, rtx_def**, bool) ()
#6  0x00b50a9b in expand_expr_real(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool) ()
#7  0x00b4a04a in store_expr_with_bounds(tree_node*, rtx_def*, int,
bool, bool, tree_node*) ()
#8  0x00b49477 in expand_assignment(tree_node*, tree_node*, bool) ()
#9  0x00a034ab in expand_call_stmt(gcall*) ()
#10 0x00a060aa in expand_gimple_stmt_1(gimple*) ()
#11 0x00a06665 in expand_gimple_stmt(gimple*) ()
#12 0x00a0c925 in expand_gimple_basic_block(basic_block_def*, bool) ()
#13 0x00a0dee6 in (anonymous
namespace)::pass_expand::execute(function*) ()
#14 0x00e14a0d in execute_one_pass(opt_pass*) ()
#15 0x00e14d72 in execute_pass_list_1(opt_pass*) ()
#16 0x00e14dfb in execute_pass_list(function*, opt_pass*) ()
#17 0x00a518e9 in cgraph_node::expand() ()
#18 0x00a51da4 in expand_all_functions() ()
#19 0x00a528f2 in symbol_table::compile() ()
#20 0x00a52b5a in symbol_table::finalize_compilation_unit() ()
#21 0x00f2f13e in compile_file() ()
#22 0x00f3177a in do_compile() ()
#23 0x00f31a57 in toplev::main(int, char**) ()
#24 0x017c994e in main ()

gcc was compiled on x86_64 to target powerpc64 as:

/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/./gcc/xgcc
-v
Используются внутренние спецификации.
COLLECT_GCC=/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/build/./gcc/xgcc
Целевая архитектура: powerpc64-unknown-linux-gnu
Параметры конфигурации:
/tmp/portage/cross-powerpc64-unknown-linux-gnu/gcc-7.2.0/work/gcc-7.2.0/configure
--host=x86_64-pc-linux-gnu --target=powerpc64-unknown-linux-gnu
--build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/powerpc64-unknown-linux-gnu/gcc-bin/7.2.0
--includedir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/7.2.0/include
--datadir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/7.2.0
--mandir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/7.2.0/man
--infodir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/7.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/7.2.0/include/g++-v7

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

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83157

Bug ID: 83157
   Summary: [8 regression] gcc.dg/guality/pr41616-1.c fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
  Target Milestone: ---

r254946 triggers this:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/gcc.dg/guality/pr41616-1.c -fno-diagnostics-show-caret
-fdiagnostics-color=never -O3 -g -g -fgnu89-inline -lm -o ./pr41616-1.exe
PASS: gcc.dg/guality/pr41616-1.c   -O3 -g  (test for excess errors)
spawn [open ...]
PASS: guality/guality.h: b is -1
FAIL: guality/guality.h: b is -1, not 1
FAIL: guality/guality.h: 1 PASS, 1 FAIL, 0 UNRESOLVED
FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  execution test

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

[Bug c/83117] [8 Regression] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (test for excess errors)

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83117

Andrey Guskov  changed:

   What|Removed |Added

 CC||andrey.y.guskov at intel dot 
com

--- Comment #4 from Andrey Guskov  ---
Also seeing this. Started with r254930.

gcc/testsuite/gcc29/ms-sysv/ms-sysv-generated.h:18060:9: warning: function
called through a non-compatible type

<...>

gcc/testsuite/gcc29/ms-sysv/ms-sysv-generated.h:32369:9: warning: function
called through a non-compatible type
gcc/testsuite/gcc29/ms-sysv/ms-sysv-generated.h:32374:9: warning: function
called through a non-compatible type
gcc/testsuite/gcc29/ms-sysv/ms-sysv-generated.h:32380:9: warning: function
called through a non-compatible type
FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p5" (test for
excess errors)

[Bug ipa/83125] [8 regression] ICE in edge_badness, at ipa-inline.c:1025

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83125

Andrey Guskov  changed:

   What|Removed |Added

 CC||andrey.y.guskov at intel dot 
com

--- Comment #2 from Andrey Guskov  ---
Possibly unrelated, but also triggered by r254924 in make check:

spawn -ignore SIGHUP /work/./gcc/xg++ -shared-libgcc -B/work/./gcc -nostdinc++
-L/work/x86_64-pc-linux-gnu/libstdc++-v3/src
-L/work/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/work/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/install/x86_64-pc-linux-gnu/bin/ -B/install/x86_64-pc-linux-gnu/lib/
-isystem /install/x86_64-pc-linux-gnu/include -isystem
/install/x86_64-pc-linux-gnu/sys-include
-B/work/x86_64-pc-linux-gnu/./libstdc++-v3/src/.libs -fmessage-length=0
-fno-show-column -ffunction-sections -fdata-sections -g -O2 -D_GNU_SOURCE
-DLOCALEDIR="." -nostdinc++
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/work/x86_64-pc-linux-gnu/libstdc++-v3/include
-I/source/libstdc++-v3/libsupc++ -I/source/libstdc++-v3/include/backward
-I/source/libstdc++-v3/testsuite/util
/source/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_value.cc
-D__STDCPP_WANT_MATH_SPEC_FUNCS__ -fno-diagnostics-show-caret
-fdiagnostics-color=never ./libtestc++.a -Wl,--gc-sections
-L/work/x86_64-pc-linux-gnu/libstdc++-v3/src/filesystem/.libs -lm -o
./check_value.exe
PASS: ext/special_functions/hyperg/check_value.cc (test for excess errors)
spawn [open ...]
FAIL: ext/special_functions/hyperg/check_value.cc execution test

[Bug fortran/83154] ICE: associate and coarrays

2017-11-25 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83154

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Confirmed with '-fcoarray=lib', the code compiles with '-fcoarray=single'. The
ICE is a regression, but the code is rejected with 7.2.0:

pr83154.f90:7:20:

 b => a(1:p, 1:p), &
1
Error: Variable 'b' at (1) is a coarray and is not ALLOCATABLE, SAVE nor a
dummy argument
pr83154.f90:8:24:

 c => a(0:p-1, 1:p  ), &
1
Error: Variable 'c' at (1) is a coarray and is not ALLOCATABLE, SAVE nor a
dummy argument
pr83154.f90:9:24:

 d => a(2:p+1, 1:p  ), &
1
Error: Variable 'd' at (1) is a coarray and is not ALLOCATABLE, SAVE nor a
dummy argument
pr83154.f90:10:24:

 e => a(1:p  , 2:p+1), &
1
Error: Variable 'e' at (1) is a coarray and is not ALLOCATABLE, SAVE nor a
dummy argument
pr83154.f90:11:24:

 f => a(1:p  , 0:p-1))
1
Error: Variable 'f' at (1) is a coarray and is not ALLOCATABLE, SAVE nor a
dummy argument

[Bug target/83156] [8 regression] gcc.target/i386/pr82361-1.c fail

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83156

--- Comment #1 from Andrey Guskov  ---
gcc.target/i386/pr82361-2.c is also affected:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/gcc.target/i386/pr82361-1.c
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxrt
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxrt/.libs
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap/.libs -fno-diagnostics-show-caret
-fdiagnostics-color=never -O2 -mtune=generic -masm=att -mno-8bit-idiv
-ffat-lto-objects -S -o pr82361-1.s
PASS: gcc.target/i386/pr82361-1.c (test for excess errors)
FAIL: gcc.target/i386/pr82361-1.c scan-assembler-not movl   %eax, %eax
FAIL: gcc.target/i386/pr82361-1.c scan-assembler-times movl %edx, %edx 2
(found 4 times)

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/gcc.target/i386/pr82361-2.c
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxrt
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxrt/.libs
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap/.libs -fno-diagnostics-show-caret
-fdiagnostics-color=never -O2 -mtune=generic -masm=att -m8bit-idiv
-ffat-lto-objects -S -o pr82361-2.s
PASS: gcc.target/i386/pr82361-2.c (test for excess errors)
FAIL: gcc.target/i386/pr82361-2.c scan-assembler-not movl   %eax, %eax

[Bug target/83156] New: [8 regression] gcc.target/i386/pr82361-1.c fail

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83156

Bug ID: 83156
   Summary: [8 regression] gcc.target/i386/pr82361-1.c fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
  Target Milestone: ---

r254874 triggers this:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/gcc.target/i386/pr82361-1.c
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxrt
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxrt/.libs
-B/work/x86_64-pc-linux-gnu/./libmpx/
-B/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap
-L/work/x86_64-pc-linux-gnu/./libmpx/mpxwrap/.libs -fno-diagnostics-show-caret
-fdiagnostics-color=never -O2 -mtune=generic -masm=att -mno-8bit-idiv
-ffat-lto-objects -S -o pr82361-1.s
PASS: gcc.target/i386/pr82361-1.c (test for excess errors)
FAIL: gcc.target/i386/pr82361-1.c scan-assembler-not movl   %eax, %eax

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

[Bug ipa/83054] [8 Regression] ICE in operator>, at profile-count.h:823

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83054

Andrey Guskov  changed:

   What|Removed |Added

 CC||andrey.y.guskov at intel dot 
com

--- Comment #1 from Andrey Guskov  ---
Make check is also affected by r254832:

spawn gdb -nx -nw -quiet -batch -x pr43051-1.gdb ./pr43051-1.exe
FAIL: gcc.dg/guality/pr43051-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  line 34 c == [0]

[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

2017-11-25 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #29 from Iain Sandoe  ---
(In reply to Dominique d'Humieres from comment #28)
> Bootstrap is fixed, but the fix did not please to Iain Sandoe.

The fix allows bootstrap to proceed, but doesn't solve the underlying problem
(which is that there are cases where the linker [ld64] is not able to determine
correct atom boundaries from the output we currently produce from GCC).

I will hopefully have some cycles for Darwin over the next month to address
this and other issues.

[Bug jit/83155] New: [8 regression] test-error-array-bounds.c.exe fail

2017-11-25 Thread andrey.y.guskov at intel dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83155

Bug ID: 83155
   Summary: [8 regression] test-error-array-bounds.c.exe fail
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: jit
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: andrey.y.guskov at intel dot com
  Target Milestone: ---

r254830 triggers this:

spawn -ignore SIGHUP /work/gcc/xgcc -B/work/gcc/
/source/gcc/testsuite/jit.dg/test-error-array-bounds.c
-fno-diagnostics-show-caret -fdiagnostics-color=never
-I/source/gcc/testsuite/../jit -lgccjit -g -Wall -Werror -Wl,--export-dynamic
-fgnu89-inline -lm -o test-error-array-bounds.c.exe
PASS: jit.dg/test-error-array-bounds.c, initial compilation
PASS:  test-error-array-bounds.c.exe iteration 1 of 5: set_up_logging: logfile
is non-null
FAIL:  test-error-array-bounds.c.exe iteration 1 of 5: verify_code: actual:
"array subscript 10 is above array bounds of 'unsigned char

Option set:
-with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-shared
--enable-host-shared --enable-clocale=gnu --enable-cloog-backend=isl
--enable-languages=c,c++,fortran,jit,lto -with-arch=haswell --with-cpu=haswell

[Bug c/81851] missing -Wduplicated-branches on if and return statements with no else

2017-11-25 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81851

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-11-25
 Ever confirmed|0   |1

--- Comment #3 from Eric Gallager  ---
Putting in WAITING for a response from Martin

[Bug fortran/83154] New: ICE: associate and coarrays

2017-11-25 Thread physiker at toast2 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83154

Bug ID: 83154
   Summary: ICE: associate and coarrays
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: physiker at toast2 dot net
  Target Milestone: ---

Compiling the program bug.f90 causes an internal compiler error. It seems the
implementation of the associate facility for coarrays is not complete. Some
features are implemented, though (see PR78152).

program co_assoc
  implicit none
  integer, parameter :: p = 5
  real, allocatable :: a(:,:)[:,:]
  allocate (a(0:p+1,0:p+1)[2,*])
  associate ( &
b => a(1:p, 1:p), &
c => a(0:p-1, 1:p  ), &
d => a(2:p+1, 1:p  ), &
e => a(1:p  , 2:p+1), &
f => a(1:p  , 0:p-1))  
  end associate
end program co_assoc

bash-3.2$ LANG=C caf bug.f90 -Wall -v
Driving: /usr/local/bin/gfortran-8
-I/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/include/OpenCoarrays-1.9.2-15-g55a3cbe_GNU-8.0.0
-fcoarray=lib -Wl,-flat_namespace -Wl,-commons,use_dylibs bug.f90 -Wall -v
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/lib/libcaf_mpi.a
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libmpifort.dylib
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libmpi.dylib
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libpmpi.dylib
-mmacosx-version-min=10.11.0 -asm_macosx_version_min=10.11 -l gfortran
-shared-libgcc
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gfortran-8
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin15.6.0/8.0.0/lto-wrapper
Target: x86_64-apple-darwin15.6.0
Configured with: ../gcc/configure --enable-languages=c,c++,fortran,lto
--with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw
--with-system-zlib --program-suffix=-8
Thread model: posix
gcc version 8.0.0 20171124 (experimental) [trunk revision 255144] (GCC) 
COLLECT_GCC_OPTIONS='-I'
'/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/include/OpenCoarrays-1.9.2-15-g55a3cbe_GNU-8.0.0'
'-fcoarray=lib' '-Wall' '-v' '-mmacosx-version-min=10.11.0'
'-asm_macosx_version_min=10.11' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin15.6.0/8.0.0/f951 bug.f90 -I
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/include/OpenCoarrays-1.9.2-15-g55a3cbe_GNU-8.0.0
-fPIC -quiet -dumpbase bug.f90 -mmacosx-version-min=10.11.0 -mtune=core2
-auxbase bug -Wall -version -fcoarray=lib -fintrinsic-modules-path
/usr/local/lib/gcc/x86_64-apple-darwin15.6.0/8.0.0/finclude -o
/var/folders/97/4qnhjhtn25s86s9hkz0h37_mgn/T//cchnI3u2.s
GNU Fortran (GCC) version 8.0.0 20171124 (experimental) [trunk revision 255144]
(x86_64-apple-darwin15.6.0)
compiled by GNU C version 8.0.0 20171124 (experimental) [trunk revision
255144], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version
isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran2008 (GCC) version 8.0.0 20171124 (experimental) [trunk revision
255144] (x86_64-apple-darwin15.6.0)
compiled by GNU C version 8.0.0 20171124 (experimental) [trunk revision
255144], GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version
isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
bug.f90:11:0:

 f => a(1:p  , 0:p-1))  

internal compiler error: in generate_coarray_sym_init, at
fortran/trans-decl.c:5236
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
Error: comand:
   `/usr/local/bin/gfortran-8
-I/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/include/OpenCoarrays-1.9.2-15-g55a3cbe_GNU-8.0.0
-fcoarray=lib -Wl,-flat_namespace -Wl,-commons,use_dylibs bug.f90 -Wall -v
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/lib/libcaf_mpi.a
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libmpifort.dylib
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libmpi.dylib
/Users/Peter/Downloads/tmp/gcc-8/OpenCoarrays/prerequisites/installations/mpich/3.2/lib/libpmpi.dylib`
failed to compile.

[Bug fortran/83153] New: Possible run time error in derived type io example - 2

2017-11-25 Thread ian at rhymneyconsulting dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83153

Bug ID: 83153
   Summary: Possible run time error in derived type io example - 2
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ian at rhymneyconsulting dot co.uk
  Target Milestone: ---

I get a similar error with the following sample code.

Here is the derived type module.

#

module ch3702_person_module

  implicit none

  type :: person

character (len=30) :: name
integer:: age
real   :: height
real   :: weight

contains

  procedure :: print_person
  generic   :: write(formatted) => print_person
  procedure :: read_person
  generic   :: read(formatted)  => read_person

  end type person

  contains

  subroutine print_person(p,unit_number,iotype,vlist,iostat,iomsg)

implicit none

class (person) , intent(in):: p
integer, intent(in):: unit_number
character (len=*)  , intent(in):: iotype
integer , dimension(:) , intent(in):: vlist
integer, intent(out)   :: iostat
character (len=*)  , intent(inout) :: iomsg

character (len=40) :: person_format

write(person_format,10)'(a',vlist(1),&
',' ,&
'i',vlist(2),&
',2x,' ,&
'f',vlist(3),&
'.',vlist(4),&
',2x,' ,&
'f',vlist(5),&
'.0)'
10 format(a,i2,&
  a,   &
  a,i1,&
  a,   &
  a,i1,&
  a,i1,&
  a,   &
  a,i1,&
  a)

write (unit_number,fmt=person_format) &
  p%name,p%age,p%height,p%weight

iostat=0

  end subroutine print_person

  subroutine read_person(p,unit_number,iotype,vlist,iostat,iomsg)

implicit none

class (person) , intent(inout) :: p
integer, intent(in):: unit_number
character (len=*)  , intent(in):: iotype
integer , dimension(:) , intent(in):: vlist
integer, intent(out)   :: iostat
character (len=*)  , intent(inout) :: iomsg

character (len=40) :: person_format

write(person_format,10)'(a',vlist(1),&
',2x,' ,&
'i',vlist(2),&
',2x,' ,&
'f',vlist(3),&
'.',vlist(4),&
',2x,' ,&
'f',vlist(5),&
'.0)'
10 format(a,i2,&
  a,   &
  a,i1,&
  a,   &
  a,i1,&
  a,i1,&
  a,   &
  a,i1,&
  a)

read (unit_number,fmt=person_format) &
  p%name,p%age,p%height,p%weight

iostat=0

  end subroutine read_person

end module ch3702_person_module

#

Here is the driving program.

#

include 'ch3702_person_module.f90'

program ch3702

  use ch3702_person_module
  integer , parameter :: n=4
  type (person) , dimension(n) :: p
  integer :: i

  open(unit=99,file='ch3701_input_file.txt')

  do i=1,n
read( 99 , 10 ) p(i)
10 format( DT(30,3,4,2,3) ) 
write( * , 20 ) p(i)
20 format( DT(20,5,4,2,3) ) 
  end do

end program ch3702

#

Here is the input file.
I have repeated the inclusion of the file even though it is the same
as in the eariler example.

#

Zahpod Beeblebrox42  1.85  75
Ford Prefect 25  1.75  65
Arthur Dent  30  1.72  68
Trillian 30  1.65  45

#

Here is the error message.

#

gfortran_ch3702
At line 95 of file ch3702_person_module.f90 (unit = 99, file =
'ch3701_input_file.txt')
Fortran runtime error: End of record

Error termination. Backtrace:

Could not print backtrace: libbacktrace could not find executable to open
#0  0x
#1  0x
#2  0x
#3  0x
#4  0x
#5  0x
#6  0x
#7  0x
#8  0x
#9  0x
#10  0x
#11  0x
#12  0x
#13  0x
#14  0x
#15  0x

#

I have two additional examples based on these derived type modules
that work when I only do the writes, with no reads.




#

[Bug fortran/83152] New: Possible run time error in derived type i/o

2017-11-25 Thread ian at rhymneyconsulting dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83152

Bug ID: 83152
   Summary: Possible run time error in derived type i/o
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ian at rhymneyconsulting dot co.uk
  Target Milestone: ---

I get the following run time error with a dtio example that I believe to be
correct. 

Here is the derived type module.

#

module ch3701_person_module

  implicit none

  type :: person

character (len=30) :: name
integer:: age
real   :: height
real   :: weight

contains

procedure :: print_person
generic   :: write(formatted) => print_person
procedure :: read_person
generic   :: read(formatted)  => read_person

  end type person

  contains

  subroutine print_person(p,unit_number,iotype,vlist,iostat,iomsg)

implicit none

class (person) , intent(in):: p
integer, intent(in):: unit_number
character (len=*)  , intent(in):: iotype
integer , dimension(:) , intent(in):: vlist
integer, intent(out)   :: iostat
character (len=*)  , intent(inout) :: iomsg

character (len=40) :: person_format

person_format="(a,2x,i3,2x,f4.2,2x,f3.0)"

write (unit_number,fmt=person_format) &
  p%name,p%age,p%height,p%weight

iostat=0

  end subroutine print_person

  subroutine read_person(p,unit_number,iotype,vlist,iostat,iomsg)

implicit none

class (person) , intent(inout) :: p
integer, intent(in):: unit_number
character (len=*)  , intent(in):: iotype
integer , dimension(:) , intent(in):: vlist
integer, intent(out)   :: iostat
character (len=*)  , intent(inout) :: iomsg

character (len=40) :: person_format

person_format='(a,2x,i3,2x,f4.2,2x,f3.0)'

read (unit_number,fmt=person_format) &
  p%name,p%age,p%height,p%weight

iostat=0

  end subroutine read_person

end module ch3701_person_module

#

Here is the main program

#

include 'ch3701_person_module.f90'

program ch3701

  use ch3701_person_module

  integer , parameter :: n=4
  type (person) , dimension(n) :: p
  integer :: i

  open(unit=99,file='ch3701_input_file.txt')

  do i=1,n
read( 99 , 10 ) p(i)
10 format( DT ) 
write( * , 20 ) p(i)
20 format( DT ) 
  end do

end program ch3701

#

Here is the data file.

#

Zahpod Beeblebrox42  1.85  75
Ford Prefect 25  1.75  65
Arthur Dent  30  1.72  68
Trillian 30  1.65  45

#

Here is the error message.

#

gfortran_ch3701.exe
At line 61 of file ch3701_person_module.f90 (unit = 99, file =
'ch3701_input_file.txt')
Fortran runtime error: End of record

Error termination. Backtrace:

Could not print backtrace: libbacktrace could not find executable to open
#0  0x
#1  0x
#2  0x
#3  0x
#4  0x
#5  0x
#6  0x
#7  0x
#8  0x
#9  0x
#10  0x
#11  0x
#12  0x
#13  0x
#14  0x
#15  0x

#

[Bug target/82848] [8 Regression] ICE in expand_expr_real_2, at expr.c:8715

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82848

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #6 from Jakub Jelinek  ---
Fixed.

[Bug c/83151] Explicit unsigned bitfields are treated as signed ones

2017-11-25 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151

--- Comment #4 from Liu Hao  ---
I do care about these warnings and that is why these warnings are enabled.
However the one in the original post seems nothing but false positive to me.


I know what the standard says about integer promotion (when used as an
arithmetic operand, any bit-field with type `int`, `unsigned` or `_Bool` will
be promoted to `int` if `int` is capable of representing all of its values
possible, and to `unsigned` otherwise). The conversion from signed types to
unsigned types are clearly implementation-defined, but according to GCC manual
"GCC supports only two’s complement integer types, and all bit patterns are
ordinary values" so conversion from unsigned types to their signed counterparts
is no-op.

No doubt adding casts would mute the warning, but sometimes it is not possible
e.g. in a compound assignment expression:

```
void set_mask(uint8_t * mask, uint8_t to_rm, uint8_t to_add){
  *mask &= ~to_rm; // This leads to a warning about conversion from `int` to
`uint8_t`.
  *mask |= to_add; // There is no warning because GCC knows the upper bits are
out of interest.
}
```

These assignment expressions have to be rewritten to use the non-compound form:

```
void set_mask(uint8_t * mask, uint8_t to_rm, uint8_t to_add){
  *mask = (uint8_t)((*mask & ~to_rm) | to_add);
}
```
, being longer, more complex, thus harder to maintain.


I believe it can still be improved, since promotion from `uint8_t` to `int`
brings in bit zeroes. The higher bits can't be set to bit ones by bitwise
and'ing with anything, hence the waring is a false positive.

[Bug target/82848] [8 Regression] ICE in expand_expr_real_2, at expr.c:8715

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82848

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Sat Nov 25 10:19:16 2017
New Revision: 255148

URL: https://gcc.gnu.org/viewcvs?rev=255148=gcc=rev
Log:
PR target/82848
* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Don't fold
builtins not enabled in the currently selected ISA.

* gcc.target/powerpc/pr82848.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/powerpc/pr82848.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/testsuite/ChangeLog

[Bug c/83151] Explicit unsigned bitfields are treated as signed ones

2017-11-25 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
So, the top bits are clear, thus ~ sets them and the conversion to unsigned
certainly does change the sign.  So, if you aren't interested in this kind of
warning, don't enable it?

[Bug c/83151] Explicit unsigned bitfields are treated as signed ones

2017-11-25 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151

Liu Hao  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Liu Hao  ---
Oh sorry for forgetting about that. I will close this PR.

BTW, despite the viability of silence the warning with a cast, will the warning
eventually go away? The promoted `int` will have its vacuum bits filled with
zeroes so there is no loss of information as if it were promoted to `unsigned`.

[Bug c/83151] Explicit unsigned bitfields are treated as signed ones

2017-11-25 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151

--- Comment #1 from Andreas Schwab  ---
The operand of ~ is promoted to int first, thus the type of the result is also
int which is then implicitly converted to unsigned int on return.

[Bug c/83151] New: Explicit unsigned bitfields are treated as signed ones

2017-11-25 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83151

Bug ID: 83151
   Summary: Explicit unsigned bitfields are treated as signed ones
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lh_mouse at 126 dot com
  Target Milestone: ---

Minimal testcase:

```c
struct foo {
  unsigned bf : 6;
};

unsigned get(const struct foo *ptr){
  return ~ptr->bf;
}
```

```
E:\Desktop>gcc -c test.c -Wall -Wextra -Wsign-conversion -Werror
test.c: In function 'get':
test.c:6:10: error: conversion to 'unsigned int' from 'int' may change the sign
of the result [-Werror=sign-conversion]
   return ~ptr->bf;
  ^~~~
cc1.exe: all warnings being treated as errors
```


GCC manual says

> -fsigned-bitfields
> -funsigned-bitfields
> -fno-signed-bitfields
> -fno-unsigned-bitfields
>   These options control whether a bit-feld is signed or unsigned, when the 
> declaration does not use either signed or unsigned. By default, such a 
> bit-feld is
>   signed, because this is consistent: the basic integer types such as int are 
> signed
>   types.

but it looks certainly incorrect if an explicit `unsigned` is specified.