[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #32 from Marek Polacek  ---
Should be fixed for GCC 8.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239
Bug 67239 depends on bug 60336, which changed state.

Bug 60336 Summary: empty struct value is passed differently in C and C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

   What|Removed |Added

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

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Marek Polacek  changed:

   What|Removed |Added

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

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-11-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #31 from Marek Polacek  ---
Author: mpolacek
Date: Wed Nov 22 16:06:18 2017
New Revision: 255066

URL: https://gcc.gnu.org/viewcvs?rev=255066=gcc=rev
Log:
PR c++/60336
PR middle-end/67239
PR target/68355
* c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* class.c (layout_class_type): Set DECL_PADDING_P on padding.
* decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
(grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.

* lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P.

* calls.c (initialize_argument_information): Call
warn_parameter_passing_abi target hook.
(store_one_arg): Use 0 for empty record size.  Don't push 0 size
argument onto stack.
(must_pass_in_stack_var_size_or_pad): Return false for empty types.
* common.opt: Update -fabi-version description.
* config/i386/i386.c (init_cumulative_args): Set cum->warn_empty.
(ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of
int_size_in_bytes.
(ix86_is_empty_record): New function.
(ix86_warn_parameter_passing_abi): New function.
(TARGET_EMPTY_RECORD_P): Redefine.
(TARGET_WARN_PARAMETER_PASSING_ABI): Redefine.
* config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty.
* doc/tm.texi: Regenerated.
* doc/tm.texi.in (TARGET_EMPTY_RECORD_P,
TARGET_WARN_PARAMETER_PASSING_ABI): Add.
* dwarf2out.c (get_ultimate_context): Move to tree.c.
* explow.c (hard_function_value): Call arg_int_size_in_bytes
instead of int_size_in_bytes.
* expr.c (copy_blkmode_to_reg): Likewise.
* function.c (aggregate_value_p): Return 0 for empty types.
(assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target
hook.
(locate_and_pad_parm): Call arg size_in_bytes instead
size_in_bytes.
* lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P.
* stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P.
* target.def (empty_record_p, warn_parameter_passing_abi): New target
hooks.
* targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook.
(std_gimplify_va_arg_expr): Skip empty records.  Call
arg_size_in_bytes instead size_in_bytes.
* targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare.
* tree-core.h (tree_type_common): Add empty_flag.
(tree_decl_common): Update comments.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream
DECL_PADDING_P.
(pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P.
* tree.c (default_is_empty_type): New function.
(default_is_empty_record): New function.
(arg_int_size_in_bytes): New function.
(arg_size_in_bytes): New function.
(get_ultimate_context): New function.
* tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and
TRANSLATION_UNIT_WARN_EMPTY_P.
(default_is_empty_record, arg_int_size_in_bytes,
arg_size_in_bytes, get_ultimate_context): Declare.

* g++.dg/abi/empty12.C: New test.
* g++.dg/abi/empty12.h: New test.
* g++.dg/abi/empty12a.c: New test.
* g++.dg/abi/empty13.C: New test.
* g++.dg/abi/empty13.h: New test.
* g++.dg/abi/empty13a.c: New test.
* g++.dg/abi/empty14.C: New test.
* g++.dg/abi/empty14.h: New test.
* g++.dg/abi/empty14a.c: New test.
* g++.dg/abi/empty15.C: New test.
* g++.dg/abi/empty15.h: New test.
* g++.dg/abi/empty15a.c: New test.
* g++.dg/abi/empty16.C: New test.
* g++.dg/abi/empty16.h: New test.
* g++.dg/abi/empty16a.c: New test.
* g++.dg/abi/empty17.C: New test.
* g++.dg/abi/empty17.h: New test.
* g++.dg/abi/empty17a.c: New test.
* g++.dg/abi/empty18.C: New test.
* g++.dg/abi/empty18.h: New test.
* g++.dg/abi/empty18a.c: New test.
* g++.dg/abi/empty19.C: New test.
* g++.dg/abi/empty19.h: New test.
* g++.dg/abi/empty19a.c: New test.
* g++.dg/abi/empty20.C: New test.
* g++.dg/abi/empty21.C: New test.
* g++.dg/abi/empty22.C: New test.
* g++.dg/abi/empty22.h: New test.
* g++.dg/abi/empty22a.c: New test.
* g++.dg/abi/empty23.C: New test.
* g++.dg/abi/empty24.C: New test.
* g++.dg/abi/empty25.C: New test.
* g++.dg/abi/empty25.h: New test.
* g++.dg/abi/empty25a.c: New test.
* g++.dg/abi/empty26.C: New test.
* g++.dg/abi/empty26.h: New test.
* g++.dg/abi/empty26a.c: New test.
* g++.dg/abi/empty27.C: 

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2017-07-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.4 |6.5

--- Comment #30 from Richard Biener  ---
GCC 6.4 is being released, adjusting target milestone.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-12-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|6.3 |6.4

--- Comment #29 from Jakub Jelinek  ---
GCC 6.3 is being released, adjusting target milestone.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #28 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.2 |6.3

--- Comment #27 from Richard Biener  ---
GCC 6.2 is being released, adjusting target milestone.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-08-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4
  Known to work||7.0
Summary|[6/7 Regression] FAIL:  |[6 Regression] FAIL:
   |23_containers/unordered_set |23_containers/unordered_set
   |/insert/hash_policy.cc  |/insert/hash_policy.cc
   |execution test  |execution test

--- Comment #26 from Richard Biener  ---
https://gcc.gnu.org/ml/gcc-testresults/2016-08/msg00487.html says it is.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-04-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #23 from H.J. Lu  ---
(In reply to Jakub Jelinek from comment #20)
> The empty class passing ABI changes were reverted and are going to be
> resolved only for GCC7+.
> I've tried your testcase (and latest preprocessed hash_policy.ii from i686
> build) with -g -O2 {,-finline-small-functions} {,-fpic} -mx32, and certainly
> don't see any .cfi_escape directives in there.  So, what is the real bug
> then?

i686 != x32.  Please try the testcase in 

https://gcc.gnu.org/bugzilla/attachment.cgi?id=38281

and compile it with -O2 -S:

[hjl@gnu-6 libstdc++-v3]$ ../../gcc/xgcc -B../../gcc/ -O2 -S hash_policy.ii
-mx32
[hjl@gnu-6 libstdc++-v3]$ grep cfi_escape hash_policy.s
.cfi_escape 0x2e,0x10
.cfi_escape 0x2e,0
[hjl@gnu-6 libstdc++-v3]$

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-04-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #22 from H.J. Lu  ---
Created attachment 38281
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38281=edit
A testcase

Compile it with -O2 -S -mx32.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-04-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #21 from H.J. Lu  ---
(In reply to Jakub Jelinek from comment #20)
> From gcc-testresults, it seems it only fails with -mx32 -fpic, and not with
> plain -mx32, but that is all I can find out.

See:

https://gcc.gnu.org/ml/gcc-regression/2016-04/msg00123.html
https://gcc.gnu.org/ml/gcc-regression/2016-04/msg00129.html

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2016-04-15 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #20 from Jakub Jelinek  ---
The empty class passing ABI changes were reverted and are going to be resolved
only for GCC7+.
I've tried your testcase (and latest preprocessed hash_policy.ii from i686
build) with -g -O2 {,-finline-small-functions} {,-fpic} -mx32, and certainly
don't see any .cfi_escape directives in there.  So, what is the real bug then?
>From gcc-testresults, it seems it only fails with -mx32 -fpic, and not with
plain -mx32, but that is all I can find out.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-26 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Richard Biener  changed:

   What|Removed |Added

   Keywords||ABI
 Status|ASSIGNED|NEW
   Assignee|rguenth at gcc dot gnu.org |unassigned at gcc dot 
gnu.org

--- Comment #19 from Richard Biener  ---
Thus not mine.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-16 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239
Bug 67239 depends on bug 68355, which changed state.

Bug 68355 Summary: C++ constexpr is passed on stack
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68355

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #17 from H.J. Lu  ---
It is related to PR 68355. With -finline-small-functions,  we call

std::_Hashtable >::_M_rehash_aux(unsigned int, std::integral_constant)

with

movq%rdi, %rbx 
movq%rdx, %r14 
subl$8, %esp 
pushq   $0   
.LEHB23:
.cfi_escape 0x2e,0x10
call   
_ZNSt10_HashtableIiiN9__gnu_cxx21throw_allocator_limitIiEENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb113_M_rehash_auxEjSt17integral_constantIbLb1EE
.LEHE23:

and we generate:

_ZNSt10_HashtableIiiN9__gnu_cxx21throw_allocator_limitIiEENSt8__detail9_IdentityESt8equal_toIiESt4hashIiENS3_18_Mod_range_hashingENS3_20_Default_ranged_hashENS3_20_Prime_rehash_policyENS3_17_Hashtable_traitsILb0ELb1ELb113_M_rehash_auxEjSt17integral_constantIbLb1EE:
.LFB9712:
.cfi_startproc
.cfi_personality 0x3,__gxx_personality_v0
.cfi_lsda 0x3,.LLSDA9712
pushq   %r15
.cfi_def_cfa_offset 16
.cfi_offset 15, -16
pushq   %r14
.cfi_def_cfa_offset 24
.cfi_offset 14, -24
pushq   %r13
.cfi_def_cfa_offset 32
.cfi_offset 13, -32
pushq   %r12
.cfi_def_cfa_offset 40
.cfi_offset 12, -40
pushq   %rbp
.cfi_def_cfa_offset 48
.cfi_offset 6, -48
pushq   %rbx
.cfi_def_cfa_offset 56
.cfi_offset 3, -56
subl$136, %esp
.cfi_def_cfa_offset 192
movq%rdi, %r15
movl%esi, %r12d
cmpl$1, %esi

Change

.cfi_escape 0x2e,0x10

to

.cfi_escape 0x2e,0

fixes the crash.  It seems that empty argument, like std::true_type, isn't
handled properly.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-15 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

H.J. Lu  changed:

   What|Removed |Added

 Depends on||60336

--- Comment #18 from H.J. Lu  ---
I think it is wrong for C++ to pass empty argument on stack. It
should be handled the same way as C.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336
[Bug 60336] empty struct value is passed differently in C and C++

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-14 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

H.J. Lu  changed:

   What|Removed |Added

 CC||hubicka at ucw dot cz

--- Comment #16 from H.J. Lu  ---
It was triggered by r222305.  It may be a latent bug.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #11 from Richard Biener  ---
Can you attach preprocessed source for x32?

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #12 from Richard Biener  ---
(In reply to Richard Biener from comment #11)
> Can you attach preprocessed source for x32?

Ah, it's in the tar file.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #13 from Richard Biener  ---
(In reply to H.J. Lu from comment #4)
> +   /* If that didn't simplify to a constant see if we have recorded
> +  temporary expressions from taken edges.  */
> +   if (!val || TREE_CODE (val) != INTEGER_CST)
> + {
> +   tree ops[2];
> +   ops[0] = gimple_cond_lhs (stmt);
> +   ops[1] = gimple_cond_rhs (stmt);
> +   val = vn_nary_op_lookup_pieces (2, gimple_cond_code (stmt),
> +   boolean_type_node, ops, NULL);
> + }
> 
> turns
> 
>  type  used unsigned type_6 SI
> size 
> unit size 
> align 32 symtab 1390664112 alias set -1 canonical type
> 0x7f205894a888 precision 32 min  max
> >
> visited var def_stmt GIMPLE_NOP
> 
> version 5>
>  
> constant 536870911>
> 
> if (__n_5(D) > 536870911)
> 
> into
> 
>  
> constant 0>
> 
> This can't be right.

If that's the transform done to
_ZN9__gnu_cxx20throw_allocator_baseINSt8__detail10_Hash_nodeIiLb0EEENS_15limit_conditionEE8allocateEjPKv
then that looks perfectly valid.  We have


  :
  if (__n_5(D) > 536870911)
goto ;
  else
goto ;

  :
  std::__throw_bad_alloc ();

  :
  _18 = _S_count;
  _19 = _S_limit;
  if (_18 == _19)
goto ;
  else
goto ;

  :
  __gnu_cxx::__throw_forced_error ();

  :
  _20 = _18 + 1;
  _S_count = _20;
  _8 = _2(D)->_M_allocator;
  if (__n_5(D) > 536870911)
goto ;
  else
goto ;

and we optimize the compare in bb 6 which is redundant as the one in BB2
dominates it.

Can you check whether disabling PRE fixes the runtime failure?

Maybe it is also just inlining of the above function that is enabled by
the patch and causes followup errors.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #14 from H.J. Lu  ---
(In reply to Richard Biener from comment #13)
> 
> Can you check whether disabling PRE fixes the runtime failure?
> 

-O1: OK.
-O1 -finline-small-functions: Bad.
-O1 -fno-tree-fre -finline-small-functions: Bad.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-13 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #15 from rguenther at suse dot de  ---
On November 14, 2015 12:09:28 AM GMT+01:00, "hjl.tools at gmail dot com"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239
>
>--- Comment #14 from H.J. Lu  ---
>(In reply to Richard Biener from comment #13)
>> 
>> Can you check whether disabling PRE fixes the runtime failure?
>> 
>
>-O1: OK.
>-O1 -finline-small-functions: Bad.
>-O1 -fno-tree-fre -finline-small-functions: Bad.

So maybe bisect with the no-fre case then.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #7 from Richard Biener  ---
(In reply to H.J. Lu from comment #6)
> Does this patch
> 
> diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
> index 2ac3828..8b57875 100644
> --- a/gcc/tree-ssa-sccvn.c
> +++ b/gcc/tree-ssa-sccvn.c
> @@ -4372,17 +4372,16 @@ sccvn_dom_walker::before_dom_children (basic_block
> bb)
>   {
> gimple *stmt = last_stmt (e->src);
> if (stmt
> -   && gimple_code (stmt) == GIMPLE_COND)
> +   && gimple_code (stmt) == GIMPLE_COND
> +   && (e->flags & EDGE_TRUE_VALUE) != 0)
>   {
> enum tree_code code = gimple_cond_code (stmt);
> tree lhs = gimple_cond_lhs (stmt);
> tree rhs = gimple_cond_rhs (stmt);
> -   record_conds (bb, code, lhs, rhs,
> - (e->flags & EDGE_TRUE_VALUE) != 0);
> +   record_conds (bb, code, lhs, rhs, true);
> code = invert_tree_comparison (code, HONOR_NANS (lhs));
> if (code != ERROR_MARK)
> - record_conds (bb, code, lhs, rhs,
> -   (e->flags & EDGE_TRUE_VALUE) == 0);
> + record_conds (bb, code, lhs, rhs, false);
>   }
>   }
>  }
> 
> make any senses? Do we need to check EDGE_FALSE_VALUE?

No, even for the false edge we can record proper expressions, see
record_conds and how it handles the cases if the condition was true or false.

Can you please attach -details dumps of the pass instance that does this?

Note that the large number '5368709811' (0x1fff) might point to a
different issue elsewhere.  Did you double-check that makes sense?

Sorry for not investigating myself but I lack a x32 runtime environment.
It would help if you attach preprocessed source with a pointer to the
function that you believe is miscompiled.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #9 from H.J. Lu  ---
Created attachment 36699
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36699=edit
tree dump

It is compiled with -O2 -mx32.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #10 from H.J. Lu  ---
(In reply to Richard Biener from comment #7)
> No, even for the false edge we can record proper expressions, see
> record_conds and how it handles the cases if the condition was true or false.
>

record_conds inserted many temporary expressions with both TRUE and FALSE
values. But

   /* If that didn't simplify to a constant see if we have recorded
   temporary expressions from taken edges.  */
if (!val || TREE_CODE (val) != INTEGER_CST)
  {
tree ops[2];
ops[0] = lhs; 
ops[1] = rhs; 
val = vn_nary_op_lookup_pieces (2, gimple_cond_code (stmt),
boolean_type_node, ops, NULL);
  }

only lookups and uses one value.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #8 from H.J. Lu  ---
(In reply to Richard Biener from comment #7)
> Can you please attach -details dumps of the pass instance that does this?

It is done in fre pass.

> Note that the large number '5368709811' (0x1fff) might point to a
> different issue elsewhere.  Did you double-check that makes sense?
> 

It came from

static size_type
 _S_max_size(_Alloc2&, ...)
 {
   return __gnu_cxx::__numeric_traits::__max
 / sizeof(value_type);
 }

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #5 from H.J. Lu  ---
It came from

  enum tree_code code = gimple_cond_code (stmt);
  tree lhs = gimple_cond_lhs (stmt);
  tree rhs = gimple_cond_rhs (stmt);
  record_conds (bb, code, lhs, rhs, 
(e->flags & EDGE_TRUE_VALUE) != 0);
  code = invert_tree_comparison (code, HONOR_NANS (lhs));

(gdb) call debug_gimple_stmt (stmt)
if (__n_5(D) > 536870911)
(gdb) 

and it records that (__n_5(D) > 536870911) is false.  It looks very odd.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #6 from H.J. Lu  ---
Does this patch

diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 2ac3828..8b57875 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -4372,17 +4372,16 @@ sccvn_dom_walker::before_dom_children (basic_block bb)
{
  gimple *stmt = last_stmt (e->src);
  if (stmt
- && gimple_code (stmt) == GIMPLE_COND)
+ && gimple_code (stmt) == GIMPLE_COND
+ && (e->flags & EDGE_TRUE_VALUE) != 0)
{
  enum tree_code code = gimple_cond_code (stmt);
  tree lhs = gimple_cond_lhs (stmt);
  tree rhs = gimple_cond_rhs (stmt);
- record_conds (bb, code, lhs, rhs,
-   (e->flags & EDGE_TRUE_VALUE) != 0);
+ record_conds (bb, code, lhs, rhs, true);
  code = invert_tree_comparison (code, HONOR_NANS (lhs));
  if (code != ERROR_MARK)
-   record_conds (bb, code, lhs, rhs,
- (e->flags & EDGE_TRUE_VALUE) == 0);
+   record_conds (bb, code, lhs, rhs, false);
}
}
 }

make any senses? Do we need to check EDGE_FALSE_VALUE?

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #4 from H.J. Lu  ---
+   /* If that didn't simplify to a constant see if we have recorded
+  temporary expressions from taken edges.  */
+   if (!val || TREE_CODE (val) != INTEGER_CST)
+ {
+   tree ops[2];
+   ops[0] = gimple_cond_lhs (stmt);
+   ops[1] = gimple_cond_rhs (stmt);
+   val = vn_nary_op_lookup_pieces (2, gimple_cond_code (stmt),
+   boolean_type_node, ops, NULL);
+ }

turns


unit size 
align 32 symtab 1390664112 alias set -1 canonical type 0x7f205894a888
precision 32 min  max >
visited var def_stmt GIMPLE_NOP

version 5>
  constant
536870911>

if (__n_5(D) > 536870911)

into

  constant
0>

This can't be right.

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-11-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #3 from H.J. Lu  ---
Still fails with r230191 at -O2:

Program received signal SIGSEGV, Segmentation fault.
0xf7571e97 in _Unwind_RaiseException (exc=)
at /export/gnu/import/git/sources/gcc/libgcc/unwind.inc:136
136 }
(gdb) bt
#0  0xf7571e97 in _Unwind_RaiseException (exc=)
at /export/gnu/import/git/sources/gcc/libgcc/unwind.inc:136
#1  0x00403510 in std::_Hashtable >::_M_rehash
(this=, __n=, __state=)
at
/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-pc-linux-gnu/x32/libstdc++-v3/include/bits/hashtable.h:1949
#2  0xcde0 in ?? ()
#3  0xcde0 in ?? ()
#4  0x0060aa20 in ?? ()
#5  0x0040358a in std::_Hashtable >::_M_insert_unique_node
(this=this@entry=0xcde0, __bkt=4294954380, __bkt@entry=0, 
__code=__code@entry=0, __node=)
at
/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-pc-linux-gnu/x32/libstdc++-v3/include/bits/hashtable.h:1587
#6  0x0040414a in std::_Hashtable
>::_M_insert > > > (__node_gen=, 
__v=@0xcddc: 0, this=0xcde0)
at
/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-pc-linux-gnu/x32/libstdc++-v3/include/bits/hashtable.h:1691
#7  std::__detail::_Insert_base >::insert (
__v=@0xcddc: 0, this=0xcde0)
at
/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-pc-linux-gnu/x32/libstdc++-v3/include/bits/hashtable_policy.h:713
#8  std::unordered_set::insert (__x=@0xcddc: 0,
this=0xcde0)
at
/export/build/gnu/gcc-x32/build-x86_64-linux/x86_64-pc-linux-gnu/x32/libstdc++-v3/include/bits/unordered_set.h:413
#9  test01 ()
at
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/23_containers/unordered_set/insert/hash_policy.cc:46
#10 0x00400f48 in main ()
at
/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/23_containers/unordered_set/insert/hash_policy.cc:110
(gdb)

[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-09-16 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

--- Comment #2 from Richard Biener  ---
*** Bug 67241 has been marked as a duplicate of this bug. ***


[Bug middle-end/67239] [6 Regression] FAIL: 23_containers/unordered_set/insert/hash_policy.cc execution test

2015-09-14 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67239

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-09-14
 CC|rguenther at suse dot de   |
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Mine.