Changeset 1864309 for patches/gcc-4.8.1-branch_update-3.patch
- Timestamp:
- Oct 1, 2013, 4:38:35 PM (11 years ago)
- Branches:
- clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- e53d8f54
- Parents:
- 23a1e45
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/gcc-4.8.1-branch_update-3.patch
r23a1e45 r1864309 1 1 Submitted By: William Harrington (kb0iic at cross-lfs dot org) 2 Date: 09-19-20132 Date: 10-01-2013 3 3 Initial Package Version: 4.8.1 4 4 Origin: Upstream … … 7 7 rechecked periodically. 8 8 9 This patch was made from Revision # 202050. 10 Added fix for BUILD¿CXXFLAGS. 11 Added fix for ISL. 9 This patch was made from Revision # 203062. 12 10 13 diff -Naur gcc-4.8.1.orig/ChangeLog gcc-4.8.1/ChangeLog 14 --- gcc-4.8.1.orig/ChangeLog 2013-05-31 09:00:41.000000000 +0000 15 +++ gcc-4.8.1/ChangeLog 2013-09-13 19:01:43.959862879 +0000 16 @@ -1,3 +1,12 @@ 17 +2013-07-13 Tobias Grosser <tobias@grosser.es> 18 + 19 + PR tree-optimization/54094 20 + * graphite-clast-to-gimple.c (translate_clast_for_loop): Derive the 21 + scheduling dimension for the parallelism check from the polyhedral 22 + information in the AST. 23 + * graphite-dependences.c (carries_deps): Do not assume the schedule is 24 + in 2D + 1 form. 25 + 26 2013-05-31 Release Manager 27 28 * GCC 4.8.1 released. 11 Added fix for BUILD_CXXFLAGS during crosscompile. 12 Added fix for ISL 2D + 1 form in parallelism check. 13 14 diff -Naur gcc-4.8.1.orig/boehm-gc/Makefile.am gcc-4.8.1/boehm-gc/Makefile.am 15 --- gcc-4.8.1.orig/boehm-gc/Makefile.am 2013-03-22 14:19:12.000000000 +0000 16 +++ gcc-4.8.1/boehm-gc/Makefile.am 2013-10-01 16:06:43.760554292 +0000 17 @@ -35,7 +35,7 @@ 18 19 # Include THREADLIBS here to ensure that the correct versions of 20 # linuxthread semaphore functions get linked: 21 -libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS) 22 +libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS) $(EXTRA_TEST_LIBS) 23 libgcjgc_la_DEPENDENCIES = $(addobjs) 24 libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir) 25 libgcjgc_la_LINK = $(LINK) $(libgcjgc_la_LDFLAGS) 26 diff -Naur gcc-4.8.1.orig/boehm-gc/Makefile.in gcc-4.8.1/boehm-gc/Makefile.in 27 --- gcc-4.8.1.orig/boehm-gc/Makefile.in 2013-05-31 09:09:26.000000000 +0000 28 +++ gcc-4.8.1/boehm-gc/Makefile.in 2013-10-01 16:06:43.760554292 +0000 29 @@ -280,7 +280,7 @@ 30 31 # Include THREADLIBS here to ensure that the correct versions of 32 # linuxthread semaphore functions get linked: 33 -libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS) 34 +libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS) $(EXTRA_TEST_LIBS) 35 libgcjgc_la_DEPENDENCIES = $(addobjs) 36 libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir) 37 libgcjgc_la_LINK = $(LINK) $(libgcjgc_la_LDFLAGS) 38 diff -Naur gcc-4.8.1.orig/configure gcc-4.8.1/configure 39 --- gcc-4.8.1.orig/configure 2013-02-15 17:45:54.000000000 +0000 40 +++ gcc-4.8.1/configure 2013-10-01 16:06:43.764554292 +0000 41 @@ -5939,6 +5939,55 @@ 42 fi 43 44 45 + if test "${gcc_cv_isl}" = no ; then 46 + 47 + if test "${ENABLE_ISL_CHECK}" = yes ; then 48 + _isl_saved_CFLAGS=$CFLAGS 49 + _isl_saved_LDFLAGS=$LDFLAGS 50 + _isl_saved_LIBS=$LIBS 51 + 52 + CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}" 53 + LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}" 54 + LIBS="${_isl_saved_LIBS} -lisl" 55 + 56 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.12 of ISL" >&5 57 +$as_echo_n "checking for version 0.12 of ISL... " >&6; } 58 + if test "$cross_compiling" = yes; then : 59 + gcc_cv_isl=yes 60 +else 61 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 62 +/* end confdefs.h. */ 63 +#include <isl/version.h> 64 + #include <string.h> 65 +int 66 +main () 67 +{ 68 +if (strncmp (isl_version (), "isl-0.12", strlen ("isl-0.12")) != 0) 69 + return 1; 70 + 71 + ; 72 + return 0; 73 +} 74 +_ACEOF 75 +if ac_fn_c_try_run "$LINENO"; then : 76 + gcc_cv_isl=yes 77 +else 78 + gcc_cv_isl=no 79 +fi 80 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 81 + conftest.$ac_objext conftest.beam conftest.$ac_ext 82 +fi 83 + 84 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5 85 +$as_echo "$gcc_cv_isl" >&6; } 86 + 87 + CFLAGS=$_isl_saved_CFLAGS 88 + LDFLAGS=$_isl_saved_LDFLAGS 89 + LIBS=$_isl_saved_LIBS 90 + fi 91 + 92 + 93 + fi 94 fi 95 96 97 diff -Naur gcc-4.8.1.orig/configure.ac gcc-4.8.1/configure.ac 98 --- gcc-4.8.1.orig/configure.ac 2013-02-15 17:45:54.000000000 +0000 99 +++ gcc-4.8.1/configure.ac 2013-10-01 16:06:43.764554292 +0000 100 @@ -1630,6 +1630,9 @@ 101 ISL_CHECK_VERSION(0,10) 102 if test "${gcc_cv_isl}" = no ; then 103 ISL_CHECK_VERSION(0,11) 104 + if test "${gcc_cv_isl}" = no ; then 105 + ISL_CHECK_VERSION(0,12) 106 + fi 107 fi 108 dnl Only execute fail-action, if ISL has been requested. 109 ISL_IF_FAILED([ 29 110 diff -Naur gcc-4.8.1.orig/fixincludes/fixincl.x gcc-4.8.1/fixincludes/fixincl.x 30 111 --- gcc-4.8.1.orig/fixincludes/fixincl.x 2013-01-16 04:07:20.000000000 +0000 31 +++ gcc-4.8.1/fixincludes/fixincl.x 2013- 09-13 19:01:42.876532387+0000112 +++ gcc-4.8.1/fixincludes/fixincl.x 2013-10-01 16:06:43.764554292 +0000 32 113 @@ -2,11 +2,11 @@ 33 114 * … … 55 136 diff -Naur gcc-4.8.1.orig/fixincludes/inclhack.def gcc-4.8.1/fixincludes/inclhack.def 56 137 --- gcc-4.8.1.orig/fixincludes/inclhack.def 2013-01-16 04:07:20.000000000 +0000 57 +++ gcc-4.8.1/fixincludes/inclhack.def 2013- 09-13 19:01:42.879865711+0000138 +++ gcc-4.8.1/fixincludes/inclhack.def 2013-10-01 16:06:43.764554292 +0000 58 139 @@ -3447,7 +3447,7 @@ 59 140 … … 76 157 diff -Naur gcc-4.8.1.orig/fixincludes/tests/base/iso/math_iso.h gcc-4.8.1/fixincludes/tests/base/iso/math_iso.h 77 158 --- gcc-4.8.1.orig/fixincludes/tests/base/iso/math_iso.h 2011-08-10 08:43:38.000000000 +0000 78 +++ gcc-4.8.1/fixincludes/tests/base/iso/math_iso.h 2013- 09-13 19:01:42.879865711+0000159 +++ gcc-4.8.1/fixincludes/tests/base/iso/math_iso.h 2013-10-01 16:06:43.764554292 +0000 79 160 @@ -10,7 +10,7 @@ 80 161 … … 86 167 __powl(__X, (long double) (__Y)); } 87 168 #endif 169 diff -Naur gcc-4.8.1.orig/gcc/ChangeLog gcc-4.8.1/gcc/ChangeLog 170 --- gcc-4.8.1.orig/gcc/ChangeLog 2013-05-31 09:02:05.000000000 +0000 171 +++ gcc-4.8.1/gcc/ChangeLog 2013-10-01 16:08:15.584551652 +0000 172 @@ -1,3 +1,12 @@ 173 +2013-07-13 Tobias Grosser <tobias@grosser.es> 174 + 175 + PR tree-optimization/54094 176 + * graphite-clast-to-gimple.c (translate_clast_for_loop): Derive the 177 + scheduling dimension for the parallelism check from the polyhedral 178 + information in the AST. 179 + * graphite-dependences.c (carries_deps): Do not assume the schedule is 180 + in 2D + 1 form. 181 + 182 2013-05-31 Release Manager 183 184 * GCC 4.8.1 released. 88 185 diff -Naur gcc-4.8.1.orig/gcc/DATESTAMP gcc-4.8.1/gcc/DATESTAMP 89 186 --- gcc-4.8.1.orig/gcc/DATESTAMP 2013-05-31 00:16:35.000000000 +0000 90 +++ gcc-4.8.1/gcc/DATESTAMP 2013- 09-13 19:01:43.079865187+0000187 +++ gcc-4.8.1/gcc/DATESTAMP 2013-10-01 16:06:43.968554286 +0000 91 188 @@ -1 +1 @@ 92 189 -20130531 93 +2013 0828190 +20131001 94 191 diff -Naur gcc-4.8.1.orig/gcc/Makefile.in gcc-4.8.1/gcc/Makefile.in 95 192 --- gcc-4.8.1.orig/gcc/Makefile.in 2013-05-21 16:00:49.000000000 +0000 96 +++ gcc-4.8.1/gcc/Makefile.in 2013- 09-13 19:01:43.176531600+0000193 +++ gcc-4.8.1/gcc/Makefile.in 2013-10-01 16:06:43.996554285 +0000 97 194 @@ -2505,7 +2505,7 @@ 98 195 $(TM_H) coretypes.h $(TREE_PASS_H) $(FLAGS_H) \ … … 106 203 diff -Naur gcc-4.8.1.orig/gcc/ada/gcc-interface/ada-tree.h gcc-4.8.1/gcc/ada/gcc-interface/ada-tree.h 107 204 --- gcc-4.8.1.orig/gcc/ada/gcc-interface/ada-tree.h 2013-02-25 19:08:51.000000000 +0000 108 +++ gcc-4.8.1/gcc/ada/gcc-interface/ada-tree.h 2013- 09-13 19:01:42.883199036+0000205 +++ gcc-4.8.1/gcc/ada/gcc-interface/ada-tree.h 2013-10-01 16:06:43.764554292 +0000 109 206 @@ -360,10 +360,6 @@ 110 207 constant CONSTRUCTOR. */ … … 120 217 diff -Naur gcc-4.8.1.orig/gcc/ada/gcc-interface/decl.c gcc-4.8.1/gcc/ada/gcc-interface/decl.c 121 218 --- gcc-4.8.1.orig/gcc/ada/gcc-interface/decl.c 2013-05-07 08:03:15.000000000 +0000 122 +++ gcc-4.8.1/gcc/ada/gcc-interface/decl.c 2013- 09-13 19:01:42.886532361+0000219 +++ gcc-4.8.1/gcc/ada/gcc-interface/decl.c 2013-10-01 16:06:43.764554292 +0000 123 220 @@ -1019,7 +1019,7 @@ 124 221 save_gnu_tree (gnat_entity, gnu_decl, true); … … 199 296 diff -Naur gcc-4.8.1.orig/gcc/ada/gcc-interface/gigi.h gcc-4.8.1/gcc/ada/gcc-interface/gigi.h 200 297 --- gcc-4.8.1.orig/gcc/ada/gcc-interface/gigi.h 2013-02-06 13:19:20.000000000 +0000 201 +++ gcc-4.8.1/gcc/ada/gcc-interface/gigi.h 2013- 09-13 19:01:42.886532361+0000298 +++ gcc-4.8.1/gcc/ada/gcc-interface/gigi.h 2013-10-01 16:06:43.768554292 +0000 202 299 @@ -177,10 +177,9 @@ 203 300 /* Given GNAT_ENTITY, an object (constant, variable, parameter, exception) … … 230 327 diff -Naur gcc-4.8.1.orig/gcc/ada/gcc-interface/trans.c gcc-4.8.1/gcc/ada/gcc-interface/trans.c 231 328 --- gcc-4.8.1.orig/gcc/ada/gcc-interface/trans.c 2013-05-26 10:04:50.000000000 +0000 232 +++ gcc-4.8.1/gcc/ada/gcc-interface/trans.c 2013-09-13 19:01:42.889865685 +0000 233 @@ -1075,19 +1075,6 @@ 329 +++ gcc-4.8.1/gcc/ada/gcc-interface/trans.c 2013-10-01 16:06:43.768554292 +0000 330 @@ -286,9 +286,6 @@ 331 tree int64_type = gnat_type_for_size (64, 0); 332 struct elab_info *info; 333 int i; 334 -#ifdef ORDINARY_MAP_INSTANCE 335 - struct line_map *map; 336 -#endif 337 338 max_gnat_nodes = max_gnat_node; 339 340 @@ -303,10 +300,6 @@ 341 342 type_annotate_only = (gigi_operating_mode == 1); 343 344 - /* ??? Disable the generation of the SCO instance table until after the 345 - back-end supports instance based debug info discriminators. */ 346 - Generate_SCO_Instance_Table = False; 347 - 348 for (i = 0; i < number_file; i++) 349 { 350 /* Use the identifier table to make a permanent copy of the filename as 351 @@ -326,11 +319,6 @@ 352 /* We create the line map for a source file at once, with a fixed number 353 of columns chosen to avoid jumping over the next power of 2. */ 354 linemap_add (line_table, LC_ENTER, 0, filename, 1); 355 -#ifdef ORDINARY_MAP_INSTANCE 356 - map = LINEMAPS_ORDINARY_MAP_AT (line_table, i); 357 - if (flag_debug_instances) 358 - ORDINARY_MAP_INSTANCE (map) = file_info_ptr[i].Instance; 359 -#endif 360 linemap_line_start (line_table, file_info_ptr[i].Num_Source_Lines, 252); 361 linemap_position_for_column (line_table, 252 - 1); 362 linemap_add (line_table, LC_LEAVE, 0, NULL, 0); 363 @@ -1075,19 +1063,6 @@ 234 364 { 235 365 const bool read_only = DECL_POINTS_TO_READONLY_P (gnu_result); … … 251 381 if (TREE_CODE (gnu_result) == PARM_DECL 252 382 && DECL_BY_COMPONENT_PTR_P (gnu_result)) 253 @@ -2280,7 +2267,10 @@ 383 @@ -1290,6 +1265,7 @@ 384 static tree 385 Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) 386 { 387 + const Node_Id gnat_prefix = Prefix (gnat_node); 388 tree gnu_prefix, gnu_type, gnu_expr; 389 tree gnu_result_type, gnu_result = error_mark_node; 390 bool prefix_unused = false; 391 @@ -1299,13 +1275,13 @@ 392 parameter types might be incomplete types coming from a limited with. */ 393 if (Ekind (Etype (gnat_node)) == E_Access_Subprogram_Type 394 && Is_Dispatch_Table_Entity (Etype (gnat_node)) 395 - && Nkind (Prefix (gnat_node)) == N_Identifier 396 - && Is_Subprogram (Entity (Prefix (gnat_node))) 397 - && Is_Public (Entity (Prefix (gnat_node))) 398 - && !present_gnu_tree (Entity (Prefix (gnat_node)))) 399 - gnu_prefix = get_minimal_subprog_decl (Entity (Prefix (gnat_node))); 400 + && Nkind (gnat_prefix) == N_Identifier 401 + && Is_Subprogram (Entity (gnat_prefix)) 402 + && Is_Public (Entity (gnat_prefix)) 403 + && !present_gnu_tree (Entity (gnat_prefix))) 404 + gnu_prefix = get_minimal_subprog_decl (Entity (gnat_prefix)); 405 else 406 - gnu_prefix = gnat_to_gnu (Prefix (gnat_node)); 407 + gnu_prefix = gnat_to_gnu (gnat_prefix); 408 gnu_type = TREE_TYPE (gnu_prefix); 409 410 /* If the input is a NULL_EXPR, make a new one. */ 411 @@ -1448,8 +1424,8 @@ 412 since it can use a special calling convention on some platforms, 413 which cannot be propagated to the access type. */ 414 else if (attribute == Attr_Access 415 - && Nkind (Prefix (gnat_node)) == N_Identifier 416 - && is_cplusplus_method (Entity (Prefix (gnat_node)))) 417 + && Nkind (gnat_prefix) == N_Identifier 418 + && is_cplusplus_method (Entity (gnat_prefix))) 419 post_error ("access to C++ constructor or member function not allowed", 420 gnat_node); 421 422 @@ -1560,13 +1536,12 @@ 423 /* If this is a dereference and we have a special dynamic constrained 424 subtype on the prefix, use it to compute the size; otherwise, use 425 the designated subtype. */ 426 - if (Nkind (Prefix (gnat_node)) == N_Explicit_Dereference) 427 + if (Nkind (gnat_prefix) == N_Explicit_Dereference) 428 { 429 - Node_Id gnat_deref = Prefix (gnat_node); 430 Node_Id gnat_actual_subtype 431 - = Actual_Designated_Subtype (gnat_deref); 432 + = Actual_Designated_Subtype (gnat_prefix); 433 tree gnu_ptr_type 434 - = TREE_TYPE (gnat_to_gnu (Prefix (gnat_deref))); 435 + = TREE_TYPE (gnat_to_gnu (Prefix (gnat_prefix))); 436 437 if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type) 438 && Present (gnat_actual_subtype)) 439 @@ -1627,7 +1602,6 @@ 440 align = DECL_ALIGN (TREE_OPERAND (gnu_prefix, 1)) / BITS_PER_UNIT; 441 else 442 { 443 - Node_Id gnat_prefix = Prefix (gnat_node); 444 Entity_Id gnat_type = Etype (gnat_prefix); 445 unsigned int double_align; 446 bool is_capped_double, align_clause; 447 @@ -1699,28 +1673,38 @@ 448 : 1), i; 449 struct parm_attr_d *pa = NULL; 450 Entity_Id gnat_param = Empty; 451 + bool unconstrained_ptr_deref = false; 452 453 /* Make sure any implicit dereference gets done. */ 454 gnu_prefix = maybe_implicit_deref (gnu_prefix); 455 gnu_prefix = maybe_unconstrained_array (gnu_prefix); 456 457 - /* We treat unconstrained array In parameters specially. */ 458 - if (!Is_Constrained (Etype (Prefix (gnat_node)))) 459 - { 460 - Node_Id gnat_prefix = Prefix (gnat_node); 461 + /* We treat unconstrained array In parameters specially. We also note 462 + whether we are dereferencing a pointer to unconstrained array. */ 463 + if (!Is_Constrained (Etype (gnat_prefix))) 464 + switch (Nkind (gnat_prefix)) 465 + { 466 + case N_Identifier: 467 + /* This is the direct case. */ 468 + if (Ekind (Entity (gnat_prefix)) == E_In_Parameter) 469 + gnat_param = Entity (gnat_prefix); 470 + break; 471 472 - /* This is the direct case. */ 473 - if (Nkind (gnat_prefix) == N_Identifier 474 - && Ekind (Entity (gnat_prefix)) == E_In_Parameter) 475 - gnat_param = Entity (gnat_prefix); 476 - 477 - /* This is the indirect case. Note that we need to be sure that 478 - the access value cannot be null as we'll hoist the load. */ 479 - if (Nkind (gnat_prefix) == N_Explicit_Dereference 480 - && Nkind (Prefix (gnat_prefix)) == N_Identifier 481 - && Ekind (Entity (Prefix (gnat_prefix))) == E_In_Parameter 482 - && Can_Never_Be_Null (Entity (Prefix (gnat_prefix)))) 483 - gnat_param = Entity (Prefix (gnat_prefix)); 484 + case N_Explicit_Dereference: 485 + /* This is the indirect case. Note that we need to be sure that 486 + the access value cannot be null as we'll hoist the load. */ 487 + if (Nkind (Prefix (gnat_prefix)) == N_Identifier 488 + && Ekind (Entity (Prefix (gnat_prefix))) == E_In_Parameter) 489 + { 490 + if (Can_Never_Be_Null (Entity (Prefix (gnat_prefix)))) 491 + gnat_param = Entity (Prefix (gnat_prefix)); 492 + } 493 + else 494 + unconstrained_ptr_deref = true; 495 + break; 496 + 497 + default: 498 + break; 499 } 500 501 /* If the prefix is the view conversion of a constrained array to an 502 @@ -1855,22 +1839,54 @@ 503 { 504 gnu_result 505 = build1 (SAVE_EXPR, TREE_TYPE (gnu_result), gnu_result); 506 - if (attribute == Attr_First) 507 - pa->first = gnu_result; 508 - else if (attribute == Attr_Last) 509 - pa->last = gnu_result; 510 - else 511 - pa->length = gnu_result; 512 + switch (attribute) 513 + { 514 + case Attr_First: 515 + pa->first = gnu_result; 516 + break; 517 + 518 + case Attr_Last: 519 + pa->last = gnu_result; 520 + break; 521 + 522 + case Attr_Length: 523 + case Attr_Range_Length: 524 + pa->length = gnu_result; 525 + break; 526 + 527 + default: 528 + gcc_unreachable (); 529 + } 530 } 531 532 - /* Set the source location onto the predicate of the condition in the 533 - 'Length case but do not do it if the expression is cached to avoid 534 - messing up the debug info. */ 535 - else if ((attribute == Attr_Range_Length || attribute == Attr_Length) 536 - && TREE_CODE (gnu_result) == COND_EXPR 537 - && EXPR_P (TREE_OPERAND (gnu_result, 0))) 538 - set_expr_location_from_node (TREE_OPERAND (gnu_result, 0), 539 - gnat_node); 540 + /* Otherwise, evaluate it each time it is referenced. */ 541 + else 542 + switch (attribute) 543 + { 544 + case Attr_First: 545 + case Attr_Last: 546 + /* If we are dereferencing a pointer to unconstrained array, we 547 + need to capture the value because the pointed-to bounds may 548 + subsequently be released. */ 549 + if (unconstrained_ptr_deref) 550 + gnu_result 551 + = build1 (SAVE_EXPR, TREE_TYPE (gnu_result), gnu_result); 552 + break; 553 + 554 + case Attr_Length: 555 + case Attr_Range_Length: 556 + /* Set the source location onto the predicate of the condition 557 + but not if the expression is cached to avoid messing up the 558 + debug info. */ 559 + if (TREE_CODE (gnu_result) == COND_EXPR 560 + && EXPR_P (TREE_OPERAND (gnu_result, 0))) 561 + set_expr_location_from_node (TREE_OPERAND (gnu_result, 0), 562 + gnat_node); 563 + break; 564 + 565 + default: 566 + gcc_unreachable (); 567 + } 568 569 break; 570 } 571 @@ -2043,8 +2059,8 @@ 572 573 case Attr_Mechanism_Code: 574 { 575 + Entity_Id gnat_obj = Entity (gnat_prefix); 576 int code; 577 - Entity_Id gnat_obj = Entity (Prefix (gnat_node)); 578 579 prefix_unused = true; 580 gnu_result_type = get_unpadded_type (Etype (gnat_node)); 581 @@ -2079,10 +2095,11 @@ 582 it has a side-effect. But don't do it if the prefix is just an entity 583 name. However, if an access check is needed, we must do it. See second 584 example in AARM 11.6(5.e). */ 585 - if (prefix_unused && TREE_SIDE_EFFECTS (gnu_prefix) 586 - && !Is_Entity_Name (Prefix (gnat_node))) 587 - gnu_result = build_compound_expr (TREE_TYPE (gnu_result), gnu_prefix, 588 - gnu_result); 589 + if (prefix_unused 590 + && TREE_SIDE_EFFECTS (gnu_prefix) 591 + && !Is_Entity_Name (gnat_prefix)) 592 + gnu_result 593 + = build_compound_expr (TREE_TYPE (gnu_result), gnu_prefix, gnu_result); 594 595 *gnu_result_type_p = gnu_result_type; 596 return gnu_result; 597 @@ -2280,7 +2297,10 @@ 254 598 if (TREE_CODE (val) != INTEGER_CST) 255 599 return true; … … 263 607 264 608 /* Return true if VAL (of type TYPE) can equal the minimum value of TYPE. 265 @@ -3251,7 +32 41,6 @@609 @@ -3251,7 +3271,6 @@ 266 610 = convert_vms_descriptor (TREE_TYPE (gnu_subprog_param), 267 611 gnu_stub_param, … … 271 615 } 272 616 else 273 @@ -3546,8 +3535,7 @@ 617 @@ -3490,6 +3509,8 @@ 618 { 619 tree gnu_retval; 620 621 + gnu_return_var_stack->pop (); 622 + 623 add_stmt (gnu_result); 624 add_stmt (build1 (LABEL_EXPR, void_type_node, 625 gnu_return_label_stack->last ())); 626 @@ -3546,8 +3567,7 @@ 274 627 bool is_var_decl = (TREE_CODE (gnu_param) == VAR_DECL); 275 628 … … 281 634 if (is_var_decl) 282 635 save_gnu_tree (gnat_param, NULL_TREE, false); 283 @@ -4009,12 + 3997,6 @@636 @@ -4009,12 +4029,6 @@ 284 637 /* The symmetry of the paths to the type of an entity is broken here 285 638 since arguments don't know that they will be passed by ref. */ … … 296 649 diff -Naur gcc-4.8.1.orig/gcc/ada/gcc-interface/utils.c gcc-4.8.1/gcc/ada/gcc-interface/utils.c 297 650 --- gcc-4.8.1.orig/gcc/ada/gcc-interface/utils.c 2013-02-06 13:19:20.000000000 +0000 298 +++ gcc-4.8.1/gcc/ada/gcc-interface/utils.c 2013- 09-13 19:01:42.893199010+0000651 +++ gcc-4.8.1/gcc/ada/gcc-interface/utils.c 2013-10-01 16:06:43.768554292 +0000 299 652 @@ -4073,33 +4073,25 @@ 300 653 … … 356 709 diff -Naur gcc-4.8.1.orig/gcc/ada/targparm.ads gcc-4.8.1/gcc/ada/targparm.ads 357 710 --- gcc-4.8.1.orig/gcc/ada/targparm.ads 2013-02-06 10:35:52.000000000 +0000 358 +++ gcc-4.8.1/gcc/ada/targparm.ads 2013- 09-13 19:01:42.893199010+0000711 +++ gcc-4.8.1/gcc/ada/targparm.ads 2013-10-01 16:06:43.768554292 +0000 359 712 @@ -436,7 +436,7 @@ 360 713 -- the source program may not contain explicit 64-bit shifts. In addition, … … 368 721 diff -Naur gcc-4.8.1.orig/gcc/asan.c gcc-4.8.1/gcc/asan.c 369 722 --- gcc-4.8.1.orig/gcc/asan.c 2013-02-28 21:23:23.000000000 +0000 370 +++ gcc-4.8.1/gcc/asan.c 2013- 09-13 19:01:42.896532334+0000723 +++ gcc-4.8.1/gcc/asan.c 2013-10-01 16:06:43.768554292 +0000 371 724 @@ -1675,7 +1675,7 @@ 372 725 access to the last byte of the argument; it uses the result of the … … 403 756 diff -Naur gcc-4.8.1.orig/gcc/c-family/c-ada-spec.c gcc-4.8.1/gcc/c-family/c-ada-spec.c 404 757 --- gcc-4.8.1.orig/gcc/c-family/c-ada-spec.c 2013-01-10 20:38:27.000000000 +0000 405 +++ gcc-4.8.1/gcc/c-family/c-ada-spec.c 2013- 09-13 19:01:42.896532334+0000758 +++ gcc-4.8.1/gcc/c-family/c-ada-spec.c 2013-10-01 16:06:43.768554292 +0000 406 759 @@ -2900,7 +2900,7 @@ 407 760 pp_string (buffer, " -- "); … … 413 766 414 767 newline_and_indent (buffer, spc); 768 diff -Naur gcc-4.8.1.orig/gcc/cfgcleanup.c gcc-4.8.1/gcc/cfgcleanup.c 769 --- gcc-4.8.1.orig/gcc/cfgcleanup.c 2013-01-30 11:53:28.000000000 +0000 770 +++ gcc-4.8.1/gcc/cfgcleanup.c 2013-10-01 16:06:43.772554291 +0000 771 @@ -927,6 +927,24 @@ 772 set_mem_align (y, MEM_ALIGN (x)); 773 } 774 } 775 + if (code == MEM) 776 + { 777 + if (MEM_READONLY_P (x) != MEM_READONLY_P (y)) 778 + { 779 + MEM_READONLY_P (x) = 0; 780 + MEM_READONLY_P (y) = 0; 781 + } 782 + if (MEM_NOTRAP_P (x) != MEM_NOTRAP_P (y)) 783 + { 784 + MEM_NOTRAP_P (x) = 0; 785 + MEM_NOTRAP_P (y) = 0; 786 + } 787 + if (MEM_VOLATILE_P (x) != MEM_VOLATILE_P (y)) 788 + { 789 + MEM_VOLATILE_P (x) = 1; 790 + MEM_VOLATILE_P (y) = 1; 791 + } 792 + } 793 794 fmt = GET_RTX_FORMAT (code); 795 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) 415 796 diff -Naur gcc-4.8.1.orig/gcc/collect2.c gcc-4.8.1/gcc/collect2.c 416 797 --- gcc-4.8.1.orig/gcc/collect2.c 2013-02-07 02:53:13.000000000 +0000 417 +++ gcc-4.8.1/gcc/collect2.c 2013- 09-13 19:01:42.899865659+0000798 +++ gcc-4.8.1/gcc/collect2.c 2013-10-01 16:06:43.772554291 +0000 418 799 @@ -366,8 +366,8 @@ 419 800 … … 561 942 diff -Naur gcc-4.8.1.orig/gcc/collect2.h gcc-4.8.1/gcc/collect2.h 562 943 --- gcc-4.8.1.orig/gcc/collect2.h 2013-01-10 20:38:27.000000000 +0000 563 +++ gcc-4.8.1/gcc/collect2.h 2013- 09-13 19:01:42.899865659+0000944 +++ gcc-4.8.1/gcc/collect2.h 2013-10-01 16:06:43.772554291 +0000 564 945 @@ -25,8 +25,6 @@ 565 946 extern struct pex_obj *collect_execute (const char *, char **, const char *, … … 573 954 diff -Naur gcc-4.8.1.orig/gcc/common/config/s390/s390-common.c gcc-4.8.1/gcc/common/config/s390/s390-common.c 574 955 --- gcc-4.8.1.orig/gcc/common/config/s390/s390-common.c 2013-01-10 20:38:27.000000000 +0000 575 +++ gcc-4.8.1/gcc/common/config/s390/s390-common.c 2013- 09-13 19:01:42.899865659+0000956 +++ gcc-4.8.1/gcc/common/config/s390/s390-common.c 2013-10-01 16:06:43.772554291 +0000 576 957 @@ -42,7 +42,7 @@ 577 958 /* z196 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT … … 585 966 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64-builtins.c gcc-4.8.1/gcc/config/aarch64/aarch64-builtins.c 586 967 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64-builtins.c 2013-02-28 17:19:33.000000000 +0000 587 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-builtins.c 2013- 09-13 19:01:42.899865659+0000968 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-builtins.c 2013-10-01 16:06:43.772554291 +0000 588 969 @@ -1154,6 +1154,7 @@ 589 970 return aarch64_simd_expand_args (target, icode, 1, exp, … … 596 977 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64-linux.h gcc-4.8.1/gcc/config/aarch64/aarch64-linux.h 597 978 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64-linux.h 2013-01-10 20:38:27.000000000 +0000 598 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-linux.h 2013- 09-13 19:01:42.903198984+0000979 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-linux.h 2013-10-01 16:06:43.772554291 +0000 599 980 @@ -23,6 +23,8 @@ 600 981 … … 608 989 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64-simd-builtins.def gcc-4.8.1/gcc/config/aarch64/aarch64-simd-builtins.def 609 990 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64-simd-builtins.def 2013-02-22 16:39:45.000000000 +0000 610 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-simd-builtins.def 2013- 09-13 19:01:42.906532308+0000991 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-simd-builtins.def 2013-10-01 16:06:43.776554291 +0000 611 992 @@ -256,3 +256,10 @@ 612 993 BUILTIN_VALL (BINOP, uzp2) … … 622 1003 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64-simd.md gcc-4.8.1/gcc/config/aarch64/aarch64-simd.md 623 1004 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64-simd.md 2013-04-11 14:14:56.000000000 +0000 624 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-simd.md 2013- 09-13 19:01:42.906532308+00001005 +++ gcc-4.8.1/gcc/config/aarch64/aarch64-simd.md 2013-10-01 16:06:43.776554291 +0000 625 1006 @@ -3457,6 +3457,17 @@ 626 1007 DONE; … … 661 1042 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64.c gcc-4.8.1/gcc/config/aarch64/aarch64.c 662 1043 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64.c 2013-05-02 17:00:00.000000000 +0000 663 +++ gcc-4.8.1/gcc/config/aarch64/aarch64.c 2013- 09-13 19:01:42.903198984+00001044 +++ gcc-4.8.1/gcc/config/aarch64/aarch64.c 2013-10-01 16:06:43.772554291 +0000 664 1045 @@ -3373,7 +3373,7 @@ 665 1046 output_operand_lossage ("invalid operand for '%%%c'", code); … … 673 1054 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/aarch64.md gcc-4.8.1/gcc/config/aarch64/aarch64.md 674 1055 --- gcc-4.8.1.orig/gcc/config/aarch64/aarch64.md 2013-04-25 17:00:44.000000000 +0000 675 +++ gcc-4.8.1/gcc/config/aarch64/aarch64.md 2013- 09-13 19:01:42.906532308+00001056 +++ gcc-4.8.1/gcc/config/aarch64/aarch64.md 2013-10-01 16:06:43.772554291 +0000 676 1057 @@ -834,7 +834,8 @@ 677 1058 movi\\t%d0, %1" … … 686 1067 diff -Naur gcc-4.8.1.orig/gcc/config/aarch64/arm_neon.h gcc-4.8.1/gcc/config/aarch64/arm_neon.h 687 1068 --- gcc-4.8.1.orig/gcc/config/aarch64/arm_neon.h 2013-04-24 15:47:21.000000000 +0000 688 +++ gcc-4.8.1/gcc/config/aarch64/arm_neon.h 2013- 09-13 19:01:42.916532282+00001069 +++ gcc-4.8.1/gcc/config/aarch64/arm_neon.h 2013-10-01 16:06:43.776554291 +0000 689 1070 @@ -8518,28 +8518,6 @@ 690 1071 return result; … … 1549 1930 diff -Naur gcc-4.8.1.orig/gcc/config/alpha/alpha.c gcc-4.8.1/gcc/config/alpha/alpha.c 1550 1931 --- gcc-4.8.1.orig/gcc/config/alpha/alpha.c 2013-01-10 20:38:27.000000000 +0000 1551 +++ gcc-4.8.1/gcc/config/alpha/alpha.c 2013-09-13 19:01:42.919865606 +0000 1552 @@ -2700,12 +2700,12 @@ 1932 +++ gcc-4.8.1/gcc/config/alpha/alpha.c 2013-10-01 16:06:43.780554291 +0000 1933 @@ -2659,6 +2659,7 @@ 1934 cmp_mode = cmp_mode == DImode ? DFmode : DImode; 1935 op0 = gen_lowpart (cmp_mode, tem); 1936 op1 = CONST0_RTX (cmp_mode); 1937 + cmp = gen_rtx_fmt_ee (code, VOIDmode, op0, op1); 1938 local_fast_math = 1; 1939 } 1940 1941 @@ -2700,12 +2701,12 @@ 1553 1942 break; 1554 1943 … … 1569 1958 1570 1959 default: 1571 @@ -3067,12 +306 7,9 @@1960 @@ -3067,12 +3068,9 @@ 1572 1961 operands[1] = op1; 1573 1962 out = gen_reg_rtx (DImode); … … 1587 1976 diff -Naur gcc-4.8.1.orig/gcc/config/alpha/alpha.md gcc-4.8.1/gcc/config/alpha/alpha.md 1588 1977 --- gcc-4.8.1.orig/gcc/config/alpha/alpha.md 2013-02-01 16:34:28.000000000 +0000 1589 +++ gcc-4.8.1/gcc/config/alpha/alpha.md 2013- 09-13 19:01:42.923198931 +00001978 +++ gcc-4.8.1/gcc/config/alpha/alpha.md 2013-10-01 16:06:43.780554291 +0000 1590 1979 @@ -23,6 +23,7 @@ 1591 1980 ;; Uses of UNSPEC in this file: … … 1598 1987 diff -Naur gcc-4.8.1.orig/gcc/config/arm/arm.c gcc-4.8.1/gcc/config/arm/arm.c 1599 1988 --- gcc-4.8.1.orig/gcc/config/arm/arm.c 2013-05-24 15:15:44.000000000 +0000 1600 +++ gcc-4.8.1/gcc/config/arm/arm.c 2013- 09-13 19:01:42.933198905+00001989 +++ gcc-4.8.1/gcc/config/arm/arm.c 2013-10-01 16:06:43.784554291 +0000 1601 1990 @@ -4459,7 +4459,9 @@ 1602 1991 if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask) … … 1680 2069 + MEM_P (SET_DEST (x)))); 1681 2070 2071 @@ -17453,7 +17475,8 @@ 2072 } 2073 } 2074 2075 - if (current_tune->prefer_ldrd_strd 2076 + if (TARGET_LDRD 2077 + && current_tune->prefer_ldrd_strd 2078 && !optimize_function_for_size_p (cfun)) 2079 { 2080 if (TARGET_THUMB2) 2081 @@ -23767,7 +23790,8 @@ 2082 } 2083 else 2084 { 2085 - if (current_tune->prefer_ldrd_strd 2086 + if (TARGET_LDRD 2087 + && current_tune->prefer_ldrd_strd 2088 && !optimize_function_for_size_p (cfun)) 2089 { 2090 if (TARGET_THUMB2) 1682 2091 diff -Naur gcc-4.8.1.orig/gcc/config/arm/neon.md gcc-4.8.1/gcc/config/arm/neon.md 1683 2092 --- gcc-4.8.1.orig/gcc/config/arm/neon.md 2013-04-04 14:34:01.000000000 +0000 1684 +++ gcc-4.8.1/gcc/config/arm/neon.md 2013- 09-13 19:01:42.936532229+00002093 +++ gcc-4.8.1/gcc/config/arm/neon.md 2013-10-01 16:06:43.784554291 +0000 1685 2094 @@ -244,7 +244,7 @@ 1686 2095 [(set (match_operand:VDQX 0 "neon_struct_or_register_operand") … … 1785 2194 if (!inverse) 1786 2195 emit_insn (base_comparison (mask, operands[4], operands[5], magic_rtx)); 2196 diff -Naur gcc-4.8.1.orig/gcc/config/arm/vfp.md gcc-4.8.1/gcc/config/arm/vfp.md 2197 --- gcc-4.8.1.orig/gcc/config/arm/vfp.md 2013-01-29 18:34:12.000000000 +0000 2198 +++ gcc-4.8.1/gcc/config/arm/vfp.md 2013-10-01 16:06:43.784554291 +0000 2199 @@ -1207,18 +1207,18 @@ 2200 (set_attr "type" "fcmpd")] 2201 ) 2202 2203 -;; Fixed point to floating point conversions. 2204 +;; Fixed point to floating point conversions. 2205 (define_code_iterator FCVT [unsigned_float float]) 2206 (define_code_attr FCVTI32typename [(unsigned_float "u32") (float "s32")]) 2207 2208 (define_insn "*combine_vcvt_f32_<FCVTI32typename>" 2209 [(set (match_operand:SF 0 "s_register_operand" "=t") 2210 (mult:SF (FCVT:SF (match_operand:SI 1 "s_register_operand" "0")) 2211 - (match_operand 2 2212 + (match_operand 2 2213 "const_double_vcvt_power_of_two_reciprocal" "Dt")))] 2214 "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math" 2215 - "vcvt.f32.<FCVTI32typename>\\t%0, %1, %v2" 2216 - [(set_attr "predicable" "no") 2217 + "vcvt%?.f32.<FCVTI32typename>\\t%0, %1, %v2" 2218 + [(set_attr "predicable" "yes") 2219 (set_attr "type" "f_cvt")] 2220 ) 2221 2222 @@ -1227,15 +1227,16 @@ 2223 (define_insn "*combine_vcvt_f64_<FCVTI32typename>" 2224 [(set (match_operand:DF 0 "s_register_operand" "=x,x,w") 2225 (mult:DF (FCVT:DF (match_operand:SI 1 "s_register_operand" "r,t,r")) 2226 - (match_operand 2 2227 + (match_operand 2 2228 "const_double_vcvt_power_of_two_reciprocal" "Dt,Dt,Dt")))] 2229 - "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math 2230 + "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP3 && !flag_rounding_math 2231 && !TARGET_VFP_SINGLE" 2232 "@ 2233 - vmov.f32\\t%0, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2 2234 - vmov.f32\\t%0, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2 2235 - vmov.f64\\t%P0, %1, %1\;vcvt.f64.<FCVTI32typename>\\t%P0, %P0, %v2" 2236 - [(set_attr "predicable" "no") 2237 + vmov%?.f32\\t%0, %1\;vcvt%?.f64.<FCVTI32typename>\\t%P0, %P0, %v2 2238 + vmov%?.f32\\t%0, %1\;vcvt%?.f64.<FCVTI32typename>\\t%P0, %P0, %v2 2239 + vmov%?.f64\\t%P0, %1, %1\;vcvt%?.f64.<FCVTI32typename>\\t%P0, %P0, %v2" 2240 + [(set_attr "predicable" "yes") 2241 + (set_attr "ce_count" "2") 2242 (set_attr "type" "f_cvt") 2243 (set_attr "length" "8")] 2244 ) 1787 2245 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr-fixed.md gcc-4.8.1/gcc/config/avr/avr-fixed.md 1788 2246 --- gcc-4.8.1.orig/gcc/config/avr/avr-fixed.md 2013-02-08 10:13:37.000000000 +0000 1789 +++ gcc-4.8.1/gcc/config/avr/avr-fixed.md 2013- 09-13 19:01:42.939865554+00002247 +++ gcc-4.8.1/gcc/config/avr/avr-fixed.md 2013-10-01 16:06:43.792554291 +0000 1790 2248 @@ -447,49 +447,18 @@ 1791 2249 ;; "roundqq3_const" "rounduqq3_const" … … 1850 2308 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr-mcus.def gcc-4.8.1/gcc/config/avr/avr-mcus.def 1851 2309 --- gcc-4.8.1.orig/gcc/config/avr/avr-mcus.def 2013-02-28 09:03:09.000000000 +0000 1852 +++ gcc-4.8.1/gcc/config/avr/avr-mcus.def 2013- 09-13 19:01:42.939865554+00002310 +++ gcc-4.8.1/gcc/config/avr/avr-mcus.def 2013-10-01 16:06:43.792554291 +0000 1853 2311 @@ -168,7 +168,6 @@ 1854 2312 AVR_MCU ("atmega169a", ARCH_AVR5, "__AVR_ATmega169A__", 0, 0, 0x0100, 1, "m169a") … … 1901 2359 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr-protos.h gcc-4.8.1/gcc/config/avr/avr-protos.h 1902 2360 --- gcc-4.8.1.orig/gcc/config/avr/avr-protos.h 2013-01-14 15:08:45.000000000 +0000 1903 +++ gcc-4.8.1/gcc/config/avr/avr-protos.h 2013- 09-13 19:01:42.943198879+00002361 +++ gcc-4.8.1/gcc/config/avr/avr-protos.h 2013-10-01 16:06:43.792554291 +0000 1904 2362 @@ -86,7 +86,8 @@ 1905 2363 extern void avr_output_addr_vec_elt (FILE *stream, int value); … … 1914 2372 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr-tables.opt gcc-4.8.1/gcc/config/avr/avr-tables.opt 1915 2373 --- gcc-4.8.1.orig/gcc/config/avr/avr-tables.opt 2013-02-28 09:03:09.000000000 +0000 1916 +++ gcc-4.8.1/gcc/config/avr/avr-tables.opt 2013- 09-13 19:01:42.946532203+00002374 +++ gcc-4.8.1/gcc/config/avr/avr-tables.opt 2013-10-01 16:06:43.792554291 +0000 1917 2375 @@ -330,479 +330,440 @@ 1918 2376 Enum(avr_mcu) String(atmega169pa) Value(101) … … 2543 3001 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr.c gcc-4.8.1/gcc/config/avr/avr.c 2544 3002 --- gcc-4.8.1.orig/gcc/config/avr/avr.c 2013-03-12 11:42:26.000000000 +0000 2545 +++ gcc-4.8.1/gcc/config/avr/avr.c 2013- 09-13 19:01:42.939865554+00003003 +++ gcc-4.8.1/gcc/config/avr/avr.c 2013-10-01 16:06:43.784554291 +0000 2546 3004 @@ -584,7 +584,12 @@ 2547 3005 { … … 2787 3245 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr.md gcc-4.8.1/gcc/config/avr/avr.md 2788 3246 --- gcc-4.8.1.orig/gcc/config/avr/avr.md 2013-02-08 10:13:37.000000000 +0000 2789 +++ gcc-4.8.1/gcc/config/avr/avr.md 2013- 09-13 19:01:42.943198879+00003247 +++ gcc-4.8.1/gcc/config/avr/avr.md 2013-10-01 16:06:43.792554291 +0000 2790 3248 @@ -140,7 +140,7 @@ 2791 3249 "out_bitop, plus, addto_sp, … … 2799 3257 diff -Naur gcc-4.8.1.orig/gcc/config/avr/avr.opt gcc-4.8.1/gcc/config/avr/avr.opt 2800 3258 --- gcc-4.8.1.orig/gcc/config/avr/avr.opt 2013-03-12 11:42:26.000000000 +0000 2801 +++ gcc-4.8.1/gcc/config/avr/avr.opt 2013- 09-13 19:01:42.943198879+00003259 +++ gcc-4.8.1/gcc/config/avr/avr.opt 2013-10-01 16:06:43.792554291 +0000 2802 3260 @@ -77,4 +77,4 @@ 2803 3261 … … 2808 3266 diff -Naur gcc-4.8.1.orig/gcc/config/avr/gen-avr-mmcu-texi.c gcc-4.8.1/gcc/config/avr/gen-avr-mmcu-texi.c 2809 3267 --- gcc-4.8.1.orig/gcc/config/avr/gen-avr-mmcu-texi.c 2013-01-14 18:09:34.000000000 +0000 2810 +++ gcc-4.8.1/gcc/config/avr/gen-avr-mmcu-texi.c 2013- 09-13 19:01:42.946532203+00003268 +++ gcc-4.8.1/gcc/config/avr/gen-avr-mmcu-texi.c 2013-10-01 16:06:43.792554291 +0000 2811 3269 @@ -68,6 +68,7 @@ 2812 3270 static void … … 2841 3299 diff -Naur gcc-4.8.1.orig/gcc/config/avr/t-multilib gcc-4.8.1/gcc/config/avr/t-multilib 2842 3300 --- gcc-4.8.1.orig/gcc/config/avr/t-multilib 2013-02-28 09:03:09.000000000 +0000 2843 +++ gcc-4.8.1/gcc/config/avr/t-multilib 2013- 09-13 19:01:42.946532203+00003301 +++ gcc-4.8.1/gcc/config/avr/t-multilib 2013-10-01 16:06:43.792554291 +0000 2844 3302 @@ -135,7 +135,6 @@ 2845 3303 mmcu?avr5=mmcu?atmega169a \ … … 2892 3350 diff -Naur gcc-4.8.1.orig/gcc/config/darwin-protos.h gcc-4.8.1/gcc/config/darwin-protos.h 2893 3351 --- gcc-4.8.1.orig/gcc/config/darwin-protos.h 2013-01-10 20:38:27.000000000 +0000 2894 +++ gcc-4.8.1/gcc/config/darwin-protos.h 2013- 09-13 19:01:42.949865528+00003352 +++ gcc-4.8.1/gcc/config/darwin-protos.h 2013-10-01 16:06:43.792554291 +0000 2895 3353 @@ -25,6 +25,7 @@ 2896 3354 extern void machopic_output_function_base_name (FILE *); … … 2903 3361 diff -Naur gcc-4.8.1.orig/gcc/config/darwin.c gcc-4.8.1/gcc/config/darwin.c 2904 3362 --- gcc-4.8.1.orig/gcc/config/darwin.c 2013-02-11 22:36:23.000000000 +0000 2905 +++ gcc-4.8.1/gcc/config/darwin.c 2013- 09-13 19:01:42.946532203+00003363 +++ gcc-4.8.1/gcc/config/darwin.c 2013-10-01 16:06:43.792554291 +0000 2906 3364 @@ -369,14 +369,13 @@ 2907 3365 … … 2954 3412 diff -Naur gcc-4.8.1.orig/gcc/config/i386/bmiintrin.h gcc-4.8.1/gcc/config/i386/bmiintrin.h 2955 3413 --- gcc-4.8.1.orig/gcc/config/i386/bmiintrin.h 2013-01-10 20:38:27.000000000 +0000 2956 +++ gcc-4.8.1/gcc/config/i386/bmiintrin.h 2013- 09-13 19:01:42.949865528+00003414 +++ gcc-4.8.1/gcc/config/i386/bmiintrin.h 2013-10-01 16:06:43.792554291 +0000 2957 3415 @@ -38,7 +38,6 @@ 2958 3416 return __builtin_ctzs (__X); … … 3084 3542 diff -Naur gcc-4.8.1.orig/gcc/config/i386/driver-i386.c gcc-4.8.1/gcc/config/i386/driver-i386.c 3085 3543 --- gcc-4.8.1.orig/gcc/config/i386/driver-i386.c 2013-05-17 15:06:36.000000000 +0000 3086 +++ gcc-4.8.1/gcc/config/i386/driver-i386.c 2013- 09-13 19:01:42.949865528+00003544 +++ gcc-4.8.1/gcc/config/i386/driver-i386.c 2013-10-01 16:06:43.792554291 +0000 3087 3545 @@ -520,8 +520,7 @@ 3088 3546 if (vendor == signature_AMD_ebx … … 3153 3611 diff -Naur gcc-4.8.1.orig/gcc/config/i386/i386.c gcc-4.8.1/gcc/config/i386/i386.c 3154 3612 --- gcc-4.8.1.orig/gcc/config/i386/i386.c 2013-05-17 15:06:36.000000000 +0000 3155 +++ gcc-4.8.1/gcc/config/i386/i386.c 2013- 09-13 19:01:42.963198826+00003613 +++ gcc-4.8.1/gcc/config/i386/i386.c 2013-10-01 16:06:43.796554291 +0000 3156 3614 @@ -2438,11 +2438,11 @@ 3157 3615 {&generic32_cost, 16, 7, 16, 7, 16}, … … 3463 3921 diff -Naur gcc-4.8.1.orig/gcc/config/i386/i386.md gcc-4.8.1/gcc/config/i386/i386.md 3464 3922 --- gcc-4.8.1.orig/gcc/config/i386/i386.md 2013-05-22 12:16:41.000000000 +0000 3465 +++ gcc-4.8.1/gcc/config/i386/i386.md 2013- 09-13 19:01:42.969865475+00003923 +++ gcc-4.8.1/gcc/config/i386/i386.md 2013-10-01 16:06:43.928554287 +0000 3466 3924 @@ -222,6 +222,8 @@ 3467 3925 UNSPECV_XEND … … 3573 4031 diff -Naur gcc-4.8.1.orig/gcc/config/i386/predicates.md gcc-4.8.1/gcc/config/i386/predicates.md 3574 4032 --- gcc-4.8.1.orig/gcc/config/i386/predicates.md 2013-01-10 20:38:27.000000000 +0000 3575 +++ gcc-4.8.1/gcc/config/i386/predicates.md 2013- 09-13 19:01:42.969865475+00004033 +++ gcc-4.8.1/gcc/config/i386/predicates.md 2013-10-01 16:06:43.928554287 +0000 3576 4034 @@ -835,19 +835,28 @@ 3577 4035 return false; … … 3617 4075 diff -Naur gcc-4.8.1.orig/gcc/config/i386/sse.md gcc-4.8.1/gcc/config/i386/sse.md 3618 4076 --- gcc-4.8.1.orig/gcc/config/i386/sse.md 2013-04-29 22:16:04.000000000 +0000 3619 +++ gcc-4.8.1/gcc/config/i386/sse.md 2013- 09-13 19:01:42.976532125+00004077 +++ gcc-4.8.1/gcc/config/i386/sse.md 2013-10-01 16:06:43.928554287 +0000 3620 4078 @@ -3603,7 +3603,7 @@ 3621 4079 (vec_select:V4SF … … 3680 4138 diff -Naur gcc-4.8.1.orig/gcc/config/i386/x86-64.h gcc-4.8.1/gcc/config/i386/x86-64.h 3681 4139 --- gcc-4.8.1.orig/gcc/config/i386/x86-64.h 2013-01-10 20:38:27.000000000 +0000 3682 +++ gcc-4.8.1/gcc/config/i386/x86-64.h 2013- 09-13 19:01:42.976532125+00004140 +++ gcc-4.8.1/gcc/config/i386/x86-64.h 2013-10-01 16:06:43.928554287 +0000 3683 4141 @@ -103,3 +103,6 @@ 3684 4142 … … 3688 4146 +#undef TARGET_SECTION_TYPE_FLAGS 3689 4147 +#define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags 4148 diff -Naur gcc-4.8.1.orig/gcc/config/pa/pa.c gcc-4.8.1/gcc/config/pa/pa.c 4149 --- gcc-4.8.1.orig/gcc/config/pa/pa.c 2013-04-06 17:46:50.000000000 +0000 4150 +++ gcc-4.8.1/gcc/config/pa/pa.c 2013-10-01 16:06:43.928554287 +0000 4151 @@ -513,6 +513,12 @@ 4152 write_symbols = NO_DEBUG; 4153 } 4154 4155 +#ifdef AUTO_INC_DEC 4156 + /* FIXME: Disable auto increment and decrement processing until reload 4157 + is completed. See PR middle-end 56791. */ 4158 + flag_auto_inc_dec = reload_completed; 4159 +#endif 4160 + 4161 /* We only support the "big PIC" model now. And we always generate PIC 4162 code when in 64bit mode. */ 4163 if (flag_pic == 1 || TARGET_64BIT) 4164 @@ -4038,7 +4044,8 @@ 4165 || (! TARGET_64BIT && df_regs_ever_live_p (i + 1))) 4166 { 4167 rtx addr, insn, reg; 4168 - addr = gen_rtx_MEM (DFmode, gen_rtx_POST_INC (DFmode, tmpreg)); 4169 + addr = gen_rtx_MEM (DFmode, 4170 + gen_rtx_POST_INC (word_mode, tmpreg)); 4171 reg = gen_rtx_REG (DFmode, i); 4172 insn = emit_move_insn (addr, reg); 4173 if (DO_FRAME_NOTES) 4174 @@ -4331,7 +4338,8 @@ 4175 if (df_regs_ever_live_p (i) 4176 || (! TARGET_64BIT && df_regs_ever_live_p (i + 1))) 4177 { 4178 - rtx src = gen_rtx_MEM (DFmode, gen_rtx_POST_INC (DFmode, tmpreg)); 4179 + rtx src = gen_rtx_MEM (DFmode, 4180 + gen_rtx_POST_INC (word_mode, tmpreg)); 4181 rtx dest = gen_rtx_REG (DFmode, i); 4182 emit_move_insn (dest, src); 4183 } 4184 diff -Naur gcc-4.8.1.orig/gcc/config/pa/pa.md gcc-4.8.1/gcc/config/pa/pa.md 4185 --- gcc-4.8.1.orig/gcc/config/pa/pa.md 2013-03-11 00:44:28.000000000 +0000 4186 +++ gcc-4.8.1/gcc/config/pa/pa.md 2013-10-01 16:06:43.932554287 +0000 4187 @@ -833,46 +833,46 @@ 4188 (define_insn "scc" 4189 [(set (match_operand:SI 0 "register_operand" "=r") 4190 (match_operator:SI 3 "comparison_operator" 4191 - [(match_operand:SI 1 "register_operand" "r") 4192 + [(match_operand:SI 1 "reg_or_0_operand" "rM") 4193 (match_operand:SI 2 "arith11_operand" "rI")]))] 4194 "" 4195 - "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi 1,%0" 4196 + "{com%I2clr|cmp%I2clr},%B3 %2,%r1,%0\;ldi 1,%0" 4197 [(set_attr "type" "binary") 4198 (set_attr "length" "8")]) 4199 4200 (define_insn "" 4201 [(set (match_operand:DI 0 "register_operand" "=r") 4202 (match_operator:DI 3 "comparison_operator" 4203 - [(match_operand:DI 1 "register_operand" "r") 4204 + [(match_operand:DI 1 "reg_or_0_operand" "rM") 4205 (match_operand:DI 2 "arith11_operand" "rI")]))] 4206 "TARGET_64BIT" 4207 - "cmp%I2clr,*%B3 %2,%1,%0\;ldi 1,%0" 4208 + "cmp%I2clr,*%B3 %2,%r1,%0\;ldi 1,%0" 4209 [(set_attr "type" "binary") 4210 (set_attr "length" "8")]) 4211 4212 (define_insn "iorscc" 4213 [(set (match_operand:SI 0 "register_operand" "=r") 4214 (ior:SI (match_operator:SI 3 "comparison_operator" 4215 - [(match_operand:SI 1 "register_operand" "r") 4216 + [(match_operand:SI 1 "reg_or_0_operand" "rM") 4217 (match_operand:SI 2 "arith11_operand" "rI")]) 4218 (match_operator:SI 6 "comparison_operator" 4219 - [(match_operand:SI 4 "register_operand" "r") 4220 + [(match_operand:SI 4 "reg_or_0_operand" "rM") 4221 (match_operand:SI 5 "arith11_operand" "rI")])))] 4222 "" 4223 - "{com%I2clr|cmp%I2clr},%S3 %2,%1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%4,%0\;ldi 1,%0" 4224 + "{com%I2clr|cmp%I2clr},%S3 %2,%r1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%r4,%0\;ldi 1,%0" 4225 [(set_attr "type" "binary") 4226 (set_attr "length" "12")]) 4227 4228 (define_insn "" 4229 [(set (match_operand:DI 0 "register_operand" "=r") 4230 (ior:DI (match_operator:DI 3 "comparison_operator" 4231 - [(match_operand:DI 1 "register_operand" "r") 4232 + [(match_operand:DI 1 "reg_or_0_operand" "rM") 4233 (match_operand:DI 2 "arith11_operand" "rI")]) 4234 (match_operator:DI 6 "comparison_operator" 4235 - [(match_operand:DI 4 "register_operand" "r") 4236 + [(match_operand:DI 4 "reg_or_0_operand" "rM") 4237 (match_operand:DI 5 "arith11_operand" "rI")])))] 4238 "TARGET_64BIT" 4239 - "cmp%I2clr,*%S3 %2,%1,%%r0\;cmp%I5clr,*%B6 %5,%4,%0\;ldi 1,%0" 4240 + "cmp%I2clr,*%S3 %2,%r1,%%r0\;cmp%I5clr,*%B6 %5,%r4,%0\;ldi 1,%0" 4241 [(set_attr "type" "binary") 4242 (set_attr "length" "12")]) 4243 4244 @@ -881,20 +881,20 @@ 4245 (define_insn "negscc" 4246 [(set (match_operand:SI 0 "register_operand" "=r") 4247 (neg:SI (match_operator:SI 3 "comparison_operator" 4248 - [(match_operand:SI 1 "register_operand" "r") 4249 + [(match_operand:SI 1 "reg_or_0_operand" "rM") 4250 (match_operand:SI 2 "arith11_operand" "rI")])))] 4251 "" 4252 - "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi -1,%0" 4253 + "{com%I2clr|cmp%I2clr},%B3 %2,%r1,%0\;ldi -1,%0" 4254 [(set_attr "type" "binary") 4255 (set_attr "length" "8")]) 4256 4257 (define_insn "" 4258 [(set (match_operand:DI 0 "register_operand" "=r") 4259 (neg:DI (match_operator:DI 3 "comparison_operator" 4260 - [(match_operand:DI 1 "register_operand" "r") 4261 + [(match_operand:DI 1 "reg_or_0_operand" "rM") 4262 (match_operand:DI 2 "arith11_operand" "rI")])))] 4263 "TARGET_64BIT" 4264 - "cmp%I2clr,*%B3 %2,%1,%0\;ldi -1,%0" 4265 + "cmp%I2clr,*%B3 %2,%r1,%0\;ldi -1,%0" 4266 [(set_attr "type" "binary") 4267 (set_attr "length" "8")]) 4268 3690 4269 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/default64.h gcc-4.8.1/gcc/config/rs6000/default64.h 3691 4270 --- gcc-4.8.1.orig/gcc/config/rs6000/default64.h 2013-01-10 20:38:27.000000000 +0000 3692 +++ gcc-4.8.1/gcc/config/rs6000/default64.h 2013- 09-13 19:01:42.976532125+00004271 +++ gcc-4.8.1/gcc/config/rs6000/default64.h 2013-10-01 16:06:43.932554287 +0000 3693 4272 @@ -18,5 +18,10 @@ 3694 4273 along with GCC; see the file COPYING3. If not see … … 3704 4283 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/dfp.md gcc-4.8.1/gcc/config/rs6000/dfp.md 3705 4284 --- gcc-4.8.1.orig/gcc/config/rs6000/dfp.md 2013-01-10 20:38:27.000000000 +0000 3706 +++ gcc-4.8.1/gcc/config/rs6000/dfp.md 2013- 09-13 19:01:42.976532125+00004285 +++ gcc-4.8.1/gcc/config/rs6000/dfp.md 2013-10-01 16:06:43.932554287 +0000 3707 4286 @@ -394,11 +394,14 @@ 3708 4287 "") … … 3726 4305 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/linux.h gcc-4.8.1/gcc/config/rs6000/linux.h 3727 4306 --- gcc-4.8.1.orig/gcc/config/rs6000/linux.h 2013-01-10 20:38:27.000000000 +0000 3728 +++ gcc-4.8.1/gcc/config/rs6000/linux.h 2013- 09-13 19:01:42.979865449+00004307 +++ gcc-4.8.1/gcc/config/rs6000/linux.h 2013-10-01 16:06:43.932554287 +0000 3729 4308 @@ -79,6 +79,24 @@ 3730 4309 #undef LINK_OS_DEFAULT_SPEC … … 3754 4333 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/linux64.h gcc-4.8.1/gcc/config/rs6000/linux64.h 3755 4334 --- gcc-4.8.1.orig/gcc/config/rs6000/linux64.h 2013-01-10 20:38:27.000000000 +0000 3756 +++ gcc-4.8.1/gcc/config/rs6000/linux64.h 2013- 09-13 19:01:42.976532125+00004335 +++ gcc-4.8.1/gcc/config/rs6000/linux64.h 2013-10-01 16:06:43.932554287 +0000 3757 4336 @@ -180,20 +180,14 @@ 3758 4337 #endif … … 3826 4405 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/linuxaltivec.h gcc-4.8.1/gcc/config/rs6000/linuxaltivec.h 3827 4406 --- gcc-4.8.1.orig/gcc/config/rs6000/linuxaltivec.h 2013-01-10 20:38:27.000000000 +0000 3828 +++ gcc-4.8.1/gcc/config/rs6000/linuxaltivec.h 2013- 09-13 19:01:42.976532125+00004407 +++ gcc-4.8.1/gcc/config/rs6000/linuxaltivec.h 2013-10-01 16:06:43.932554287 +0000 3829 4408 @@ -20,8 +20,13 @@ 3830 4409 <http://www.gnu.org/licenses/>. */ … … 3843 4422 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/linuxspe.h gcc-4.8.1/gcc/config/rs6000/linuxspe.h 3844 4423 --- gcc-4.8.1.orig/gcc/config/rs6000/linuxspe.h 2013-01-10 20:38:27.000000000 +0000 3845 +++ gcc-4.8.1/gcc/config/rs6000/linuxspe.h 2013- 09-13 19:01:42.979865449+00004424 +++ gcc-4.8.1/gcc/config/rs6000/linuxspe.h 2013-10-01 16:06:43.932554287 +0000 3846 4425 @@ -20,8 +20,13 @@ 3847 4426 <http://www.gnu.org/licenses/>. */ … … 3860 4439 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/predicates.md gcc-4.8.1/gcc/config/rs6000/predicates.md 3861 4440 --- gcc-4.8.1.orig/gcc/config/rs6000/predicates.md 2013-01-10 20:38:27.000000000 +0000 3862 +++ gcc-4.8.1/gcc/config/rs6000/predicates.md 2013-09-13 19:01:42.979865449 +0000 3863 @@ -464,9 +464,11 @@ 4441 +++ gcc-4.8.1/gcc/config/rs6000/predicates.md 2013-10-01 16:06:43.932554287 +0000 4442 @@ -275,14 +275,18 @@ 4443 (ior (match_code "const_int") 4444 (match_operand 0 "gpc_reg_operand"))) 4445 4446 +;; Return 1 if op is a constant integer valid for addition with addis, addi. 4447 +(define_predicate "add_cint_operand" 4448 + (and (match_code "const_int") 4449 + (match_test "(unsigned HOST_WIDE_INT) 4450 + (INTVAL (op) + (mode == SImode ? 0x80000000 : 0x80008000)) 4451 + < (unsigned HOST_WIDE_INT) 0x100000000ll"))) 4452 + 4453 ;; Return 1 if op is a constant integer valid for addition 4454 ;; or non-special register. 4455 (define_predicate "reg_or_add_cint_operand" 4456 (if_then_else (match_code "const_int") 4457 - (match_test "(HOST_BITS_PER_WIDE_INT == 32 4458 - && (mode == SImode || INTVAL (op) < 0x7fff8000)) 4459 - || ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80008000) 4460 - < (unsigned HOST_WIDE_INT) 0x100000000ll)") 4461 + (match_operand 0 "add_cint_operand") 4462 (match_operand 0 "gpc_reg_operand"))) 4463 4464 ;; Return 1 if op is a constant integer valid for subtraction 4465 @@ -464,9 +468,11 @@ 3864 4466 (match_test "easy_altivec_constant (op, mode)"))) 3865 4467 { … … 3874 4476 return EASY_VECTOR_15_ADD_SELF (val); 3875 4477 }) 3876 @@ -478,9 +48 0,11 @@4478 @@ -478,9 +484,11 @@ 3877 4479 (match_test "easy_altivec_constant (op, mode)"))) 3878 4480 { … … 3887 4489 }) 3888 4490 4491 @@ -1521,7 +1529,7 @@ 4492 (define_predicate "small_toc_ref" 4493 (match_code "unspec,plus") 4494 { 4495 - if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1))) 4496 + if (GET_CODE (op) == PLUS && add_cint_operand (XEXP (op, 1), mode)) 4497 op = XEXP (op, 0); 4498 4499 return GET_CODE (op) == UNSPEC && XINT (op, 1) == UNSPEC_TOCREL; 3889 4500 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/rs6000.c gcc-4.8.1/gcc/config/rs6000/rs6000.c 3890 4501 --- gcc-4.8.1.orig/gcc/config/rs6000/rs6000.c 2013-05-10 01:54:06.000000000 +0000 3891 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.c 2013-09-13 19:01:42.986532098 +0000 3892 @@ -2190,7 +2190,8 @@ 4502 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.c 2013-10-01 16:06:43.936554287 +0000 4503 @@ -284,9 +284,6 @@ 4504 { "rsqrtd", (RECIP_DF_RSQRT | RECIP_V2DF_RSQRT) }, 4505 }; 4506 4507 -/* 2 argument gen function typedef. */ 4508 -typedef rtx (*gen_2arg_fn_t) (rtx, rtx, rtx); 4509 - 4510 /* Pointer to function (in rs6000-c.c) that can define or undefine target 4511 macros that have changed. Languages that don't support the preprocessor 4512 don't link in rs6000-c.c, so we can't call it directly. */ 4513 @@ -2190,7 +2187,8 @@ 3893 4514 int reg_size2 = reg_size; 3894 4515 … … 3900 4521 3901 4522 rs6000_class_max_nregs[m][c] 3902 @@ -4239,7 +42 40,7 @@4523 @@ -4239,7 +4237,7 @@ 3903 4524 bitsize = GET_MODE_BITSIZE (inner); 3904 4525 mask = GET_MODE_MASK (inner); … … 3909 4530 msb_val = val > 0 ? 0 : -1; 3910 4531 3911 @@ -4279,7 +42 80,7 @@4532 @@ -4279,7 +4277,7 @@ 3912 4533 for (i = 0; i < nunits - 1; ++i) 3913 4534 { … … 3918 4539 else 3919 4540 desired_val = msb_val; 3920 @@ -4364,13 +436 5,13 @@4541 @@ -4364,13 +4362,13 @@ 3921 4542 { 3922 4543 enum machine_mode mode = GET_MODE (op); … … 3934 4555 /* Then try with a vspltish. */ 3935 4556 if (step == 1) 3936 @@ -4379,7 +43 80,7 @@4557 @@ -4379,7 +4377,7 @@ 3937 4558 step >>= 1; 3938 4559 … … 3943 4564 /* And finally a vspltisb. */ 3944 4565 if (step == 1) 3945 @@ -4388,7 +438 9,7 @@4566 @@ -4388,7 +4386,7 @@ 3946 4567 step >>= 1; 3947 4568 … … 3952 4573 gcc_unreachable (); 3953 4574 } 3954 @@ -9066,19 +9067,20 @@ 4575 @@ -5337,7 +5335,7 @@ 4576 4577 tocrel_base = op; 4578 tocrel_offset = const0_rtx; 4579 - if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1))) 4580 + if (GET_CODE (op) == PLUS && add_cint_operand (XEXP (op, 1), GET_MODE (op))) 4581 { 4582 tocrel_base = XEXP (op, 0); 4583 tocrel_offset = XEXP (op, 1); 4584 @@ -9066,19 +9064,20 @@ 3955 4585 && cfun->va_list_gpr_size) 3956 4586 { … … 3977 4607 mem = gen_rtx_MEM (BLKmode, 3978 4608 plus_constant (Pmode, save_area, 3979 @@ -16900,8 +16 902,9 @@4609 @@ -16900,8 +16899,9 @@ 3980 4610 shift = gen_reg_rtx (SImode); 3981 4611 addr = gen_lowpart (SImode, addr); … … 3989 4619 3990 4620 /* Mask for insertion. */ 3991 @@ -19957,8 +199 60,7 @@4621 @@ -19957,8 +19957,7 @@ 3992 4622 HOST_WIDE_INT offset; 3993 4623 … … 3999 4629 spe_save_area_ptr = gen_rtx_REG (Pmode, 11); 4000 4630 save_off = frame_off - offset; 4001 @@ -21200,8 +21 202,7 @@4631 @@ -21200,8 +21199,7 @@ 4002 4632 anew to every function. */ 4003 4633 … … 4009 4639 emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, 4010 4640 GEN_INT (info->spe_gp_save_offset 4011 @@ -22151,20 +221 52,22 @@4641 @@ -22151,20 +22149,22 @@ 4012 4642 4013 4643 if (TARGET_64BIT) … … 4036 4666 else 4037 4667 fprintf (file, "\t.tc FT_%lx_%lx_%lx_%lx[TC],", 4038 @@ -22191,18 +2219 4,19 @@4668 @@ -22191,18 +22191,19 @@ 4039 4669 4040 4670 if (TARGET_64BIT) … … 4059 4689 else 4060 4690 fprintf (file, "\t.tc FD_%lx_%lx[TC],", 4061 @@ -22226,16 +222 30,19 @@4691 @@ -22226,16 +22227,19 @@ 4062 4692 4063 4693 if (TARGET_64BIT) … … 4082 4712 else 4083 4713 fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff); 4084 @@ -22267,9 +2227 4,8 @@4714 @@ -22267,9 +22271,8 @@ 4085 4715 } 4086 4716 #endif … … 4094 4724 a separate constant pool, because then we'd have 4095 4725 to have both a TOC entry _and_ the actual constant.) 4096 @@ -22280,7 +2228 6,7 @@4726 @@ -22280,7 +22283,7 @@ 4097 4727 /* It would be easy to make this work, but it doesn't now. */ 4098 4728 gcc_assert (!TARGET_64BIT || POINTER_SIZE >= GET_MODE_BITSIZE (mode)); … … 4103 4733 #if HOST_BITS_PER_WIDE_INT == 32 4104 4734 lshift_double (low, high, POINTER_SIZE - GET_MODE_BITSIZE (mode), 4105 @@ -22295,7 +22 301,7 @@4735 @@ -22295,7 +22298,7 @@ 4106 4736 4107 4737 if (TARGET_64BIT) … … 4112 4742 else 4113 4743 fprintf (file, "\t.tc ID_%lx_%lx[TC],", 4114 @@ -22308,7 +2231 4,7 @@4744 @@ -22308,7 +22311,7 @@ 4115 4745 { 4116 4746 if (POINTER_SIZE < GET_MODE_BITSIZE (mode)) … … 4121 4751 else 4122 4752 fprintf (file, "\t.tc ID_%lx_%lx[TC],", 4123 @@ -22318,7 +2232 4,7 @@4753 @@ -22318,7 +22321,7 @@ 4124 4754 } 4125 4755 else … … 4130 4760 else 4131 4761 fprintf (file, "\t.tc IS_%lx[TC],", (long) low & 0xffffffff); 4132 @@ -22356,7 +223 62,7 @@4762 @@ -22356,7 +22359,7 @@ 4133 4763 gcc_unreachable (); 4134 4764 } … … 4139 4769 else 4140 4770 { 4771 @@ -26651,7 +26654,7 @@ 4772 enum machine_mode mode = GET_MODE (dst); 4773 rtx x0, e0, e1, y1, u0, v0; 4774 enum insn_code code = optab_handler (smul_optab, mode); 4775 - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); 4776 + insn_gen_fn gen_mul = GEN_FCN (code); 4777 rtx one = rs6000_load_constant_and_splat (mode, dconst1); 4778 4779 gcc_assert (code != CODE_FOR_nothing); 4780 @@ -26689,7 +26692,7 @@ 4781 enum machine_mode mode = GET_MODE (dst); 4782 rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one; 4783 enum insn_code code = optab_handler (smul_optab, mode); 4784 - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); 4785 + insn_gen_fn gen_mul = GEN_FCN (code); 4786 4787 gcc_assert (code != CODE_FOR_nothing); 4788 4789 @@ -26760,7 +26763,7 @@ 4790 int i; 4791 rtx halfthree; 4792 enum insn_code code = optab_handler (smul_optab, mode); 4793 - gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code); 4794 + insn_gen_fn gen_mul = GEN_FCN (code); 4795 4796 gcc_assert (code != CODE_FOR_nothing); 4797 4141 4798 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/rs6000.h gcc-4.8.1/gcc/config/rs6000/rs6000.h 4142 4799 --- gcc-4.8.1.orig/gcc/config/rs6000/rs6000.h 2013-05-06 23:33:49.000000000 +0000 4143 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.h 2013- 09-13 19:01:42.989865423+00004800 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.h 2013-10-01 16:06:43.936554287 +0000 4144 4801 @@ -662,6 +662,11 @@ 4145 4802 instructions for them. Might as well be consistent with bits and bytes. */ … … 4170 4827 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/rs6000.md gcc-4.8.1/gcc/config/rs6000/rs6000.md 4171 4828 --- gcc-4.8.1.orig/gcc/config/rs6000/rs6000.md 2013-02-07 08:04:58.000000000 +0000 4172 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.md 2013- 09-13 19:01:42.993198747 +00004829 +++ gcc-4.8.1/gcc/config/rs6000/rs6000.md 2013-10-01 16:06:43.936554287 +0000 4173 4830 @@ -1990,6 +1990,8 @@ 4174 4831 [(set_attr "length" "4,4,12") … … 4189 4846 [(set (match_operand:SI 0 "gpc_reg_operand" "") 4190 4847 (bswap:SI (match_operand:SI 1 "gpc_reg_operand" "")))] 4191 @@ -2125,8 +2129,10 @@ 4848 @@ -2106,7 +2110,9 @@ 4849 (clobber (match_scratch:DI 3 "=&r,&r,&r")) 4850 (clobber (match_scratch:DI 4 "=&r,X,&r"))] 4851 "TARGET_POWERPC64 && !TARGET_LDBRX 4852 - && (REG_P (operands[0]) || REG_P (operands[1]))" 4853 + && (REG_P (operands[0]) || REG_P (operands[1])) 4854 + && !(MEM_P (operands[0]) && MEM_VOLATILE_P (operands[0])) 4855 + && !(MEM_P (operands[1]) && MEM_VOLATILE_P (operands[1]))" 4856 "#" 4857 [(set_attr "length" "16,12,36")]) 4858 4859 @@ -2125,8 +2131,10 @@ 4192 4860 rtx op2 = operands[2]; 4193 4861 rtx op3 = operands[3]; … … 4202 4870 rtx addr2; 4203 4871 rtx word_high; 4204 @@ -2186,8 +219 2,10 @@4872 @@ -2186,8 +2194,10 @@ 4205 4873 rtx src = operands[1]; 4206 4874 rtx op2 = operands[2]; … … 4215 4883 rtx addr2; 4216 4884 rtx word_high; 4217 @@ -2221,16 +22 29,14 @@4885 @@ -2221,16 +2231,14 @@ 4218 4886 { 4219 4887 word_high = change_address (dest, SImode, addr1); … … 4234 4902 4235 4903 (define_split 4236 @@ -2247,10 +225 3,11 @@4904 @@ -2247,10 +2255,11 @@ 4237 4905 rtx src = operands[1]; 4238 4906 rtx op2 = operands[2]; … … 4250 4918 emit_insn (gen_lshrdi3 (op2, src, GEN_INT (32))); 4251 4919 emit_insn (gen_bswapsi2 (dest_si, src_si)); 4252 @@ -2275,15 +228 2,15 @@4920 @@ -2275,15 +2284,15 @@ 4253 4921 [(const_int 0)] 4254 4922 " … … 4273 4941 addr1 = XEXP (src, 0); 4274 4942 if (GET_CODE (addr1) == PLUS) 4275 @@ -2308,19 +231 5,11 @@4943 @@ -2308,19 +2317,11 @@ 4276 4944 addr2 = gen_rtx_PLUS (SImode, op2, addr1); 4277 4945 } … … 4297 4965 4298 4966 (define_split 4299 @@ -2331,15 +233 0,15 @@4967 @@ -2331,15 +2332,15 @@ 4300 4968 [(const_int 0)] 4301 4969 " … … 4320 4988 addr1 = XEXP (dest, 0); 4321 4989 if (GET_CODE (addr1) == PLUS) 4322 @@ -2364,19 +236 3,11 @@4990 @@ -2364,19 +2365,11 @@ 4323 4991 addr2 = gen_rtx_PLUS (SImode, op2, addr1); 4324 4992 } … … 4344 5012 4345 5013 (define_split 4346 @@ -2387,15 +23 78,15 @@5014 @@ -2387,15 +2380,15 @@ 4347 5015 [(const_int 0)] 4348 5016 " … … 4368 5036 4369 5037 (define_insn "mulsi3" 4370 @@ -4682,6 +467 3,41 @@5038 @@ -4682,6 +4675,41 @@ 4371 5039 "frsqrtes %0,%1" 4372 5040 [(set_attr "type" "fp")]) … … 4410 5078 [(set (match_dup 3) 4411 5079 (abs:SFDF (match_operand:SFDF 1 "gpc_reg_operand" ""))) 4412 @@ -6210,10 +623 6,25 @@5080 @@ -6210,10 +6238,25 @@ 4413 5081 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r") 4414 5082 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") … … 4440 5108 (set_attr "length" "8,12")]) 4441 5109 4442 @@ -7064,13 +710 5,12 @@5110 @@ -7064,13 +7107,12 @@ 4443 5111 [(set (match_operand:DI 0 "gpc_reg_operand" "") 4444 5112 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "") … … 4456 5124 emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2])); 4457 5125 DONE; 4458 @@ -8277,8 +831 7,8 @@5126 @@ -8277,8 +8319,8 @@ 4459 5127 "&& reload_completed" 4460 5128 [(pc)] … … 4467 5135 operands[1]); 4468 5136 emit_move_insn (simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word), 4469 @@ -8507,8 +854 7,8 @@5137 @@ -8507,8 +8549,8 @@ 4470 5138 && TARGET_LONG_DOUBLE_128" 4471 5139 " … … 4478 5146 operands[4] = gen_reg_rtx (CCFPmode); 4479 5147 operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word); 4480 @@ -11609,8 +11649,8 @@ 5148 @@ -10422,7 +10464,7 @@ 5149 (unspec [(match_operand:DI 1 "" "") 5150 (match_operand:DI 2 "gpc_reg_operand" "b")] 5151 UNSPEC_TOCREL) 5152 - (match_operand 3 "const_int_operand" "n"))))] 5153 + (match_operand:DI 3 "add_cint_operand" "n"))))] 5154 "TARGET_ELF && TARGET_CMODEL != CMODEL_SMALL" 5155 "addis %0,%2,%1+%3@toc@ha") 5156 5157 @@ -10433,7 +10475,7 @@ 5158 (unspec [(match_operand:P 1 "" "") 5159 (match_operand:P 2 "gpc_reg_operand" "b")] 5160 UNSPEC_TOCREL) 5161 - (match_operand 3 "const_int_operand" "n"))))] 5162 + (match_operand:P 3 "add_cint_operand" "n"))))] 5163 "TARGET_XCOFF && TARGET_CMODEL != CMODEL_SMALL" 5164 "addis %0,%1+%3@u(%2)") 5165 5166 @@ -11609,8 +11651,8 @@ 4481 5167 (match_dup 13)] 4482 5168 { … … 4491 5177 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/rtems.h gcc-4.8.1/gcc/config/rs6000/rtems.h 4492 5178 --- gcc-4.8.1.orig/gcc/config/rs6000/rtems.h 2013-01-10 20:38:27.000000000 +0000 4493 +++ gcc-4.8.1/gcc/config/rs6000/rtems.h 2013- 09-13 19:01:42.996532072+00005179 +++ gcc-4.8.1/gcc/config/rs6000/rtems.h 2013-10-01 16:06:43.936554287 +0000 4494 5180 @@ -34,6 +34,9 @@ 4495 5181 } \ … … 4504 5190 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/spe.md gcc-4.8.1/gcc/config/rs6000/spe.md 4505 5191 --- gcc-4.8.1.orig/gcc/config/rs6000/spe.md 2013-01-10 20:38:27.000000000 +0000 4506 +++ gcc-4.8.1/gcc/config/rs6000/spe.md 2013- 09-13 19:01:42.996532072+00005192 +++ gcc-4.8.1/gcc/config/rs6000/spe.md 2013-10-01 16:06:43.940554287 +0000 4507 5193 @@ -2604,8 +2604,8 @@ 4508 5194 && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" … … 4529 5215 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/sysv4.h gcc-4.8.1/gcc/config/rs6000/sysv4.h 4530 5216 --- gcc-4.8.1.orig/gcc/config/rs6000/sysv4.h 2013-01-10 20:38:27.000000000 +0000 4531 +++ gcc-4.8.1/gcc/config/rs6000/sysv4.h 2013- 09-13 19:01:42.996532072+00005217 +++ gcc-4.8.1/gcc/config/rs6000/sysv4.h 2013-10-01 16:06:43.940554287 +0000 4532 5218 @@ -187,12 +187,6 @@ 4533 5219 rs6000_abi_name); \ … … 4615 5301 diff -Naur gcc-4.8.1.orig/gcc/config/rs6000/sysv4le.h gcc-4.8.1/gcc/config/rs6000/sysv4le.h 4616 5302 --- gcc-4.8.1.orig/gcc/config/rs6000/sysv4le.h 2013-01-10 20:38:27.000000000 +0000 4617 +++ gcc-4.8.1/gcc/config/rs6000/sysv4le.h 2013- 09-13 19:01:42.999865397 +00005303 +++ gcc-4.8.1/gcc/config/rs6000/sysv4le.h 2013-10-01 16:06:43.940554287 +0000 4618 5304 @@ -25,12 +25,12 @@ 4619 5305 #undef CC1_ENDIAN_DEFAULT_SPEC … … 4636 5322 diff -Naur gcc-4.8.1.orig/gcc/config/s390/htmintrin.h gcc-4.8.1/gcc/config/s390/htmintrin.h 4637 5323 --- gcc-4.8.1.orig/gcc/config/s390/htmintrin.h 1970-01-01 00:00:00.000000000 +0000 4638 +++ gcc-4.8.1/gcc/config/s390/htmintrin.h 2013- 09-13 19:01:42.999865397 +00005324 +++ gcc-4.8.1/gcc/config/s390/htmintrin.h 2013-10-01 16:06:43.940554287 +0000 4639 5325 @@ -0,0 +1,57 @@ 4640 5326 +/* GNU compiler hardware transactional execution intrinsics … … 4697 5383 diff -Naur gcc-4.8.1.orig/gcc/config/s390/htmxlintrin.h gcc-4.8.1/gcc/config/s390/htmxlintrin.h 4698 5384 --- gcc-4.8.1.orig/gcc/config/s390/htmxlintrin.h 1970-01-01 00:00:00.000000000 +0000 4699 +++ gcc-4.8.1/gcc/config/s390/htmxlintrin.h 2013- 09-13 19:01:42.999865397 +00005385 +++ gcc-4.8.1/gcc/config/s390/htmxlintrin.h 2013-10-01 16:06:43.940554287 +0000 4700 5386 @@ -0,0 +1,182 @@ 4701 5387 +/* XL compiler hardware transactional execution intrinsics … … 4883 5569 diff -Naur gcc-4.8.1.orig/gcc/config/s390/predicates.md gcc-4.8.1/gcc/config/s390/predicates.md 4884 5570 --- gcc-4.8.1.orig/gcc/config/s390/predicates.md 2013-01-10 20:38:27.000000000 +0000 4885 +++ gcc-4.8.1/gcc/config/s390/predicates.md 2013- 09-13 19:01:42.999865397 +00005571 +++ gcc-4.8.1/gcc/config/s390/predicates.md 2013-10-01 16:06:43.940554287 +0000 4886 5572 @@ -176,7 +176,11 @@ 4887 5573 { … … 4912 5598 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390-modes.def gcc-4.8.1/gcc/config/s390/s390-modes.def 4913 5599 --- gcc-4.8.1.orig/gcc/config/s390/s390-modes.def 2013-01-10 20:38:27.000000000 +0000 4914 +++ gcc-4.8.1/gcc/config/s390/s390-modes.def 2013- 09-13 19:01:43.009865370+00005600 +++ gcc-4.8.1/gcc/config/s390/s390-modes.def 2013-10-01 16:06:43.944554286 +0000 4915 5601 @@ -152,6 +152,14 @@ 4916 5602 operands were equal/unequal. The CCZ1 mode ensures the result can be … … 4935 5621 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390-protos.h gcc-4.8.1/gcc/config/s390/s390-protos.h 4936 5622 --- gcc-4.8.1.orig/gcc/config/s390/s390-protos.h 2013-01-10 20:38:27.000000000 +0000 4937 +++ gcc-4.8.1/gcc/config/s390/s390-protos.h 2013- 09-13 19:01:43.009865370+00005623 +++ gcc-4.8.1/gcc/config/s390/s390-protos.h 2013-10-01 16:06:43.944554286 +0000 4938 5624 @@ -58,7 +58,7 @@ 4939 5625 extern enum machine_mode s390_tm_ccmode (rtx, rtx, bool); … … 4955 5641 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390.c gcc-4.8.1/gcc/config/s390/s390.c 4956 5642 --- gcc-4.8.1.orig/gcc/config/s390/s390.c 2013-04-08 07:55:57.000000000 +0000 4957 +++ gcc-4.8.1/gcc/config/s390/s390.c 2013- 09-13 19:01:43.003198721+00005643 +++ gcc-4.8.1/gcc/config/s390/s390.c 2013-10-01 16:06:43.940554287 +0000 4958 5644 @@ -367,6 +367,10 @@ 4959 5645 const char *some_ld_name; … … 5100 5786 { 5101 5787 if (target_flags_explicit & MASK_HARD_DFP) 5102 @@ -7341,11 +7377,11 @@ 5788 @@ -7028,25 +7064,12 @@ 5789 or a casesi jump, check all potential targets. */ 5790 else if (GET_CODE (insn) == JUMP_INSN) 5791 { 5792 - rtx pat = PATTERN (insn); 5793 - if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) > 2) 5794 - pat = XVECEXP (pat, 0, 0); 5795 - 5796 - if (GET_CODE (pat) == SET) 5797 - { 5798 - rtx label = JUMP_LABEL (insn); 5799 - if (label) 5800 - { 5801 - if (s390_find_pool (pool_list, label) 5802 - != s390_find_pool (pool_list, insn)) 5803 - bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); 5804 - } 5805 - } 5806 - else if (GET_CODE (pat) == PARALLEL 5807 - && XVECLEN (pat, 0) == 2 5808 - && GET_CODE (XVECEXP (pat, 0, 0)) == SET 5809 - && GET_CODE (XVECEXP (pat, 0, 1)) == USE 5810 - && GET_CODE (XEXP (XVECEXP (pat, 0, 1), 0)) == LABEL_REF) 5811 + rtx pat = PATTERN (insn); 5812 + if (GET_CODE (pat) == PARALLEL 5813 + && XVECLEN (pat, 0) == 2 5814 + && GET_CODE (XVECEXP (pat, 0, 0)) == SET 5815 + && GET_CODE (XVECEXP (pat, 0, 1)) == USE 5816 + && GET_CODE (XEXP (XVECEXP (pat, 0, 1), 0)) == LABEL_REF) 5817 { 5818 /* Find the jump table used by this casesi jump. */ 5819 rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0); 5820 @@ -7068,8 +7091,23 @@ 5821 bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); 5822 } 5823 } 5824 + continue; 5825 } 5826 - } 5827 + 5828 + if (GET_CODE (pat) == PARALLEL) 5829 + pat = XVECEXP (pat, 0, 0); 5830 + 5831 + if (GET_CODE (pat) == SET) 5832 + { 5833 + rtx label = JUMP_LABEL (insn); 5834 + if (label) 5835 + { 5836 + if (s390_find_pool (pool_list, label) 5837 + != s390_find_pool (pool_list, insn)) 5838 + bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (label)); 5839 + } 5840 + } 5841 + } 5842 } 5843 5844 /* Insert base register reload insns before every pool. */ 5845 @@ -7341,11 +7379,11 @@ 5103 5846 if (GET_CODE (setreg) == SUBREG) 5104 5847 { … … 5114 5857 else 5115 5858 return; 5116 @@ -7368,13 +740 4,13 @@5859 @@ -7368,13 +7406,13 @@ 5117 5860 rtx cur_insn; 5118 5861 unsigned int i; … … 5130 5873 } 5131 5874 5132 @@ -7396,7 +743 2,7 @@5875 @@ -7396,7 +7434,7 @@ 5133 5876 See expand_builtin_unwind_init. For regs_ever_live this is done by 5134 5877 reload. */ … … 5139 5882 regs_ever_clobbered[i] = 1; 5140 5883 5141 @@ -7462,17 +7 498,6 @@5884 @@ -7462,17 +7500,6 @@ 5142 5885 { 5143 5886 int i, j; … … 5157 5900 data, except that we don't save and restore global registers. 5158 5901 5159 @@ -7481,6 +750 6,28 @@5902 @@ -7481,6 +7508,28 @@ 5160 5903 5161 5904 s390_regs_ever_clobbered (clobbered_regs); … … 5186 5929 clobbered_regs[i] = clobbered_regs[i] && !global_regs[i] && !fixed_regs[i]; 5187 5930 5188 @@ -7731,7 +77 78,7 @@5931 @@ -7731,7 +7780,7 @@ 5189 5932 { 5190 5933 HOST_WIDE_INT frame_size; … … 5195 5938 /* On S/390 machines, we may need to perform branch splitting, which 5196 5939 will require both base and return address register. We have no 5197 @@ -7766,6 +781 3,157 @@5940 @@ -7766,6 +7815,157 @@ 5198 5941 while (frame_size != cfun_frame_layout.frame_size); 5199 5942 } … … 5353 6096 current info and update regs_ever_live for the special registers. 5354 6097 May be called multiple times, but may never cause *more* registers 5355 @@ -7774,7 +797 2,7 @@6098 @@ -7774,7 +7974,7 @@ 5356 6099 static void 5357 6100 s390_update_frame_layout (void) … … 5362 6105 s390_register_info (clobbered_regs); 5363 6106 5364 @@ -8204,8 +840 2,10 @@6107 @@ -8204,8 +8404,10 @@ 5365 6108 int offset; 5366 6109 int next_fpr = 0; … … 5374 6117 5375 6118 /* Annotate all constant pool references to let the scheduler know 5376 @@ -9353,6 +955 3,291 @@6119 @@ -9353,6 +9555,291 @@ 5377 6120 return build_va_arg_indirect_ref (addr); 5378 6121 } … … 5666 6409 stdio stream FILE. 5667 6410 5668 @@ -11008,6 +1149 3,11 @@6411 @@ -11008,6 +11495,11 @@ 5669 6412 #undef TARGET_RETURN_IN_MEMORY 5670 6413 #define TARGET_RETURN_IN_MEMORY s390_return_in_memory … … 5680 6423 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390.h gcc-4.8.1/gcc/config/s390/s390.h 5681 6424 --- gcc-4.8.1.orig/gcc/config/s390/s390.h 2013-03-05 12:02:06.000000000 +0000 5682 +++ gcc-4.8.1/gcc/config/s390/s390.h 2013- 09-13 19:01:43.003198721+00006425 +++ gcc-4.8.1/gcc/config/s390/s390.h 2013-10-01 16:06:43.940554287 +0000 5683 6426 @@ -34,7 +34,8 @@ 5684 6427 PF_DFP = 16, … … 5762 6505 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390.md gcc-4.8.1/gcc/config/s390/s390.md 5763 6506 --- gcc-4.8.1.orig/gcc/config/s390/s390.md 2013-01-10 20:38:27.000000000 +0000 5764 +++ gcc-4.8.1/gcc/config/s390/s390.md 2013- 09-13 19:01:43.009865370+00006507 +++ gcc-4.8.1/gcc/config/s390/s390.md 2013-10-01 16:06:43.944554286 +0000 5765 6508 @@ -59,11 +59,17 @@ 5766 6509 (define_c_enum "unspec" [ … … 6186 6929 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390.opt gcc-4.8.1/gcc/config/s390/s390.opt 6187 6930 --- gcc-4.8.1.orig/gcc/config/s390/s390.opt 2013-01-10 20:38:27.000000000 +0000 6188 +++ gcc-4.8.1/gcc/config/s390/s390.opt 2013- 09-13 19:01:43.009865370+00006931 +++ gcc-4.8.1/gcc/config/s390/s390.opt 2013-10-01 16:06:43.944554286 +0000 6189 6932 @@ -104,6 +104,10 @@ 6190 6933 Target Report RejectNegative Negative(mlong-double-128) InverseMask(LONG_DOUBLE_128) … … 6200 6943 diff -Naur gcc-4.8.1.orig/gcc/config/s390/s390intrin.h gcc-4.8.1/gcc/config/s390/s390intrin.h 6201 6944 --- gcc-4.8.1.orig/gcc/config/s390/s390intrin.h 1970-01-01 00:00:00.000000000 +0000 6202 +++ gcc-4.8.1/gcc/config/s390/s390intrin.h 2013- 09-13 19:01:43.006532046+00006945 +++ gcc-4.8.1/gcc/config/s390/s390intrin.h 2013-10-01 16:06:43.940554287 +0000 6203 6946 @@ -0,0 +1,33 @@ 6204 6947 +/* S/390 System z specific intrinsics … … 6237 6980 diff -Naur gcc-4.8.1.orig/gcc/config/sh/sh.md gcc-4.8.1/gcc/config/sh/sh.md 6238 6981 --- gcc-4.8.1.orig/gcc/config/sh/sh.md 2013-05-06 19:53:56.000000000 +0000 6239 +++ gcc-4.8.1/gcc/config/sh/sh.md 2013-09-13 19:01:43.016532020 +0000 6240 @@ -12073,10 +12073,10 @@ 6982 +++ gcc-4.8.1/gcc/config/sh/sh.md 2013-10-01 16:06:43.944554286 +0000 6983 @@ -6834,10 +6834,11 @@ 6984 ;; If movqi_reg_reg is specified as an alternative of movqi, movqi will be 6985 ;; selected to copy QImode regs. If one of them happens to be allocated 6986 ;; on the stack, reload will stick to movqi insn and generate wrong 6987 -;; displacement addressing because of the generic m alternatives. 6988 -;; With the movqi_reg_reg being specified before movqi it will be initially 6989 -;; picked to load/store regs. If the regs regs are on the stack reload will 6990 -;; try other insns and not stick to movqi_reg_reg. 6991 +;; displacement addressing because of the generic m alternatives. 6992 +;; With the movqi_reg_reg being specified before movqi it will be initially 6993 +;; picked to load/store regs. If the regs regs are on the stack reload 6994 +;; try other insns and not stick to movqi_reg_reg, unless there were spilled 6995 +;; pseudos in which case 'm' constraints pertain. 6996 ;; The same applies to the movhi variants. 6997 ;; 6998 ;; Notice, that T bit is not allowed as a mov src operand here. This is to 6999 @@ -6849,11 +6850,14 @@ 7000 ;; reloading MAC subregs otherwise. For that probably special patterns 7001 ;; would be required. 7002 (define_insn "*mov<mode>_reg_reg" 7003 - [(set (match_operand:QIHI 0 "arith_reg_dest" "=r") 7004 - (match_operand:QIHI 1 "register_operand" "r"))] 7005 + [(set (match_operand:QIHI 0 "arith_reg_dest" "=r,m,*z") 7006 + (match_operand:QIHI 1 "register_operand" "r,*z,m"))] 7007 "TARGET_SH1 && !t_reg_operand (operands[1], VOIDmode)" 7008 - "mov %1,%0" 7009 - [(set_attr "type" "move")]) 7010 + "@ 7011 + mov %1,%0 7012 + mov.<bw> %1,%0 7013 + mov.<bw> %1,%0" 7014 + [(set_attr "type" "move,store,load")]) 7015 7016 ;; FIXME: The non-SH2A and SH2A variants should be combined by adding 7017 ;; "enabled" attribute as it is done in other targets. 7018 @@ -12073,10 +12077,10 @@ 6241 7019 6242 7020 ;; FMA (fused multiply-add) patterns … … 6253 7031 { 6254 7032 if (TARGET_SH2E) 6255 @@ -12107,6 +121 07,43 @@7033 @@ -12107,6 +12111,43 @@ 6256 7034 "fmac.s %1, %2, %0" 6257 7035 [(set_attr "type" "fparith_media")]) … … 6299 7077 diff -Naur gcc-4.8.1.orig/gcc/config/sparc/sparc.c gcc-4.8.1/gcc/config/sparc/sparc.c 6300 7078 --- gcc-4.8.1.orig/gcc/config/sparc/sparc.c 2013-04-15 08:31:12.000000000 +0000 6301 +++ gcc-4.8.1/gcc/config/sparc/sparc.c 2013- 09-13 19:01:43.019865344+00007079 +++ gcc-4.8.1/gcc/config/sparc/sparc.c 2013-10-01 16:06:43.944554286 +0000 6302 7080 @@ -11174,6 +11174,11 @@ 6303 7081 /* Total Store Ordering: all memory transactions with store semantics … … 6314 7092 diff -Naur gcc-4.8.1.orig/gcc/config.gcc gcc-4.8.1/gcc/config.gcc 6315 7093 --- gcc-4.8.1.orig/gcc/config.gcc 2013-03-13 09:47:41.000000000 +0000 6316 +++ gcc-4.8.1/gcc/config.gcc 2013- 09-13 19:01:43.023198669+00007094 +++ gcc-4.8.1/gcc/config.gcc 2013-10-01 16:06:43.948554286 +0000 6317 7095 @@ -452,6 +452,7 @@ 6318 7096 cpu_type=s390 … … 6362 7140 diff -Naur gcc-4.8.1.orig/gcc/config.in gcc-4.8.1/gcc/config.in 6363 7141 --- gcc-4.8.1.orig/gcc/config.in 2013-05-31 09:09:26.000000000 +0000 6364 +++ gcc-4.8.1/gcc/config.in 2013- 09-13 19:01:43.023198669+00007142 +++ gcc-4.8.1/gcc/config.in 2013-10-01 16:06:43.948554286 +0000 6365 7143 @@ -1228,7 +1228,7 @@ 6366 7144 #endif … … 6374 7152 diff -Naur gcc-4.8.1.orig/gcc/configure gcc-4.8.1/gcc/configure 6375 7153 --- gcc-4.8.1.orig/gcc/configure 2013-05-08 11:36:36.000000000 +0000 6376 +++ gcc-4.8.1/gcc/configure 2013- 09-13 19:01:43.973196178+00007154 +++ gcc-4.8.1/gcc/configure 2013-10-01 16:06:55.812553945 +0000 6377 7155 @@ -11703,6 +11703,7 @@ 6378 7156 if test x$build != x$host || test "x$coverage_flags" != x … … 6463 7241 diff -Naur gcc-4.8.1.orig/gcc/configure.ac gcc-4.8.1/gcc/configure.ac 6464 7242 --- gcc-4.8.1.orig/gcc/configure.ac 2013-05-08 11:36:36.000000000 +0000 6465 +++ gcc-4.8.1/gcc/configure.ac 2013- 09-13 19:01:43.976529502+00007243 +++ gcc-4.8.1/gcc/configure.ac 2013-10-01 16:06:55.816553945 +0000 6466 7244 @@ -1887,6 +1887,7 @@ 6467 7245 if test x$build != x$host || test "x$coverage_flags" != x … … 6561 7339 diff -Naur gcc-4.8.1.orig/gcc/cp/call.c gcc-4.8.1/gcc/cp/call.c 6562 7340 --- gcc-4.8.1.orig/gcc/cp/call.c 2013-05-14 12:51:17.000000000 +0000 6563 +++ gcc-4.8.1/gcc/cp/call.c 2013- 09-13 19:01:43.036531967+00007341 +++ gcc-4.8.1/gcc/cp/call.c 2013-10-01 16:06:43.952554286 +0000 6564 7342 @@ -6195,8 +6195,8 @@ 6565 7343 if (convs->check_narrowing) … … 6584 7362 diff -Naur gcc-4.8.1.orig/gcc/cp/class.c gcc-4.8.1/gcc/cp/class.c 6585 7363 --- gcc-4.8.1.orig/gcc/cp/class.c 2013-04-01 19:05:21.000000000 +0000 6586 +++ gcc-4.8.1/gcc/cp/class.c 2013- 09-13 19:01:43.039865292+00007364 +++ gcc-4.8.1/gcc/cp/class.c 2013-10-01 16:06:43.952554286 +0000 6587 7365 @@ -4574,15 +4574,20 @@ 6588 7366 static void … … 6654 7432 a DECL for the field or TYPE itself (DR 253). */ 6655 7433 7434 @@ -7465,7 +7508,7 @@ 7435 dependent on overload resolution. */ 7436 gcc_assert (TREE_CODE (rhs) == ADDR_EXPR 7437 || TREE_CODE (rhs) == COMPONENT_REF 7438 - || really_overloaded_fn (rhs) 7439 + || is_overloaded_fn (rhs) 7440 || (flag_ms_extensions && TREE_CODE (rhs) == FUNCTION_DECL)); 7441 7442 /* This should really only be used when attempting to distinguish 6656 7443 diff -Naur gcc-4.8.1.orig/gcc/cp/cp-tree.h gcc-4.8.1/gcc/cp/cp-tree.h 6657 7444 --- gcc-4.8.1.orig/gcc/cp/cp-tree.h 2013-04-24 15:42:20.000000000 +0000 6658 +++ gcc-4.8.1/gcc/cp/cp-tree.h 2013- 09-13 19:01:43.043198616 +00007445 +++ gcc-4.8.1/gcc/cp/cp-tree.h 2013-10-01 16:06:43.956554286 +0000 6659 7446 @@ -1211,17 +1211,20 @@ 6660 7447 /* The _DECL for this _TYPE. */ … … 6722 7509 diff -Naur gcc-4.8.1.orig/gcc/cp/cvt.c gcc-4.8.1/gcc/cp/cvt.c 6723 7510 --- gcc-4.8.1.orig/gcc/cp/cvt.c 2013-02-20 09:02:35.000000000 +0000 6724 +++ gcc-4.8.1/gcc/cp/cvt.c 2013- 09-13 19:01:43.043198616 +00007511 +++ gcc-4.8.1/gcc/cp/cvt.c 2013-10-01 16:06:43.956554286 +0000 6725 7512 @@ -620,6 +620,9 @@ 6726 7513 … … 6777 7564 diff -Naur gcc-4.8.1.orig/gcc/cp/decl.c gcc-4.8.1/gcc/cp/decl.c 6778 7565 --- gcc-4.8.1.orig/gcc/cp/decl.c 2013-05-16 15:09:07.000000000 +0000 6779 +++ gcc-4.8.1/gcc/cp/decl.c 2013- 09-13 19:01:43.049865266 +00007566 +++ gcc-4.8.1/gcc/cp/decl.c 2013-10-01 16:06:43.956554286 +0000 6780 7567 @@ -10878,7 +10878,7 @@ 6781 7568 DECL, if there is no DECL available. */ … … 6833 7620 diff -Naur gcc-4.8.1.orig/gcc/cp/init.c gcc-4.8.1/gcc/cp/init.c 6834 7621 --- gcc-4.8.1.orig/gcc/cp/init.c 2013-04-25 16:25:04.000000000 +0000 6835 +++ gcc-4.8.1/gcc/cp/init.c 2013- 09-13 19:01:43.049865266 +00007622 +++ gcc-4.8.1/gcc/cp/init.c 2013-10-01 16:06:43.956554286 +0000 6836 7623 @@ -3524,6 +3524,8 @@ 6837 7624 … … 6843 7630 else if (from_array) 6844 7631 { 7632 @@ -4062,6 +4064,7 @@ 7633 tree cookie_addr; 7634 tree size_ptr_type = build_pointer_type (sizetype); 7635 7636 + base = mark_rvalue_use (base); 7637 if (TREE_SIDE_EFFECTS (base)) 7638 { 7639 base_init = get_target_expr (base); 6845 7640 diff -Naur gcc-4.8.1.orig/gcc/cp/method.c gcc-4.8.1/gcc/cp/method.c 6846 7641 --- gcc-4.8.1.orig/gcc/cp/method.c 2013-02-12 20:47:15.000000000 +0000 6847 +++ gcc-4.8.1/gcc/cp/method.c 2013- 09-13 19:01:43.053198590+00007642 +++ gcc-4.8.1/gcc/cp/method.c 2013-10-01 16:06:43.956554286 +0000 6848 7643 @@ -1340,7 +1340,8 @@ 6849 7644 if (diag && assign_p && move_p … … 6858 7653 diff -Naur gcc-4.8.1.orig/gcc/cp/name-lookup.c gcc-4.8.1/gcc/cp/name-lookup.c 6859 7654 --- gcc-4.8.1.orig/gcc/cp/name-lookup.c 2013-02-27 18:13:24.000000000 +0000 6860 +++ gcc-4.8.1/gcc/cp/name-lookup.c 2013- 09-13 19:01:43.053198590+00007655 +++ gcc-4.8.1/gcc/cp/name-lookup.c 2013-10-01 16:06:43.956554286 +0000 6861 7656 @@ -3015,8 +3015,10 @@ 6862 7657 if (name == error_mark_node) … … 6874 7669 diff -Naur gcc-4.8.1.orig/gcc/cp/parser.c gcc-4.8.1/gcc/cp/parser.c 6875 7670 --- gcc-4.8.1.orig/gcc/cp/parser.c 2013-05-14 20:37:48.000000000 +0000 6876 +++ gcc-4.8.1/gcc/cp/parser.c 2013- 09-13 19:01:43.063198564+00007671 +++ gcc-4.8.1/gcc/cp/parser.c 2013-10-01 16:06:43.960554286 +0000 6877 7672 @@ -5438,11 +5438,18 @@ 6878 7673 /* Restore the old message. */ … … 6930 7725 diff -Naur gcc-4.8.1.orig/gcc/cp/pt.c gcc-4.8.1/gcc/cp/pt.c 6931 7726 --- gcc-4.8.1.orig/gcc/cp/pt.c 2013-05-24 13:25:44.000000000 +0000 6932 +++ gcc-4.8.1/gcc/cp/pt.c 2013- 09-13 19:01:43.069865213+00007727 +++ gcc-4.8.1/gcc/cp/pt.c 2013-10-01 16:06:43.964554286 +0000 6933 7728 @@ -138,6 +138,7 @@ 6934 7729 tree); … … 7194 7989 { 7195 7990 if (TREE_CODE (expression) == ADDR_EXPR) 7991 @@ -20077,7 +20127,7 @@ 7992 any_type_dependent_elements_p (const_tree list) 7993 { 7994 for (; list; list = TREE_CHAIN (list)) 7995 - if (value_dependent_expression_p (TREE_VALUE (list))) 7996 + if (type_dependent_expression_p (TREE_VALUE (list))) 7997 return true; 7998 7999 return false; 7196 8000 @@ -20626,7 +20676,7 @@ 7197 8001 = build_tree_list (NULL_TREE, TYPE_NAME (auto_node)); … … 7205 8009 diff -Naur gcc-4.8.1.orig/gcc/cp/semantics.c gcc-4.8.1/gcc/cp/semantics.c 7206 8010 --- gcc-4.8.1.orig/gcc/cp/semantics.c 2013-05-14 12:51:17.000000000 +0000 7207 +++ gcc-4.8.1/gcc/cp/semantics.c 2013- 09-13 19:01:43.073198538+00008011 +++ gcc-4.8.1/gcc/cp/semantics.c 2013-10-01 16:06:43.964554286 +0000 7208 8012 @@ -155,6 +155,17 @@ 7209 8013 } … … 7296 8100 diff -Naur gcc-4.8.1.orig/gcc/cp/tree.c gcc-4.8.1/gcc/cp/tree.c 7297 8101 --- gcc-4.8.1.orig/gcc/cp/tree.c 2013-05-24 13:25:51.000000000 +0000 7298 +++ gcc-4.8.1/gcc/cp/tree.c 2013- 09-13 19:01:43.073198538+00008102 +++ gcc-4.8.1/gcc/cp/tree.c 2013-10-01 16:06:43.964554286 +0000 7299 8103 @@ -1220,6 +1220,8 @@ 7300 8104 result = … … 7308 8112 diff -Naur gcc-4.8.1.orig/gcc/cp/typeck.c gcc-4.8.1/gcc/cp/typeck.c 7309 8113 --- gcc-4.8.1.orig/gcc/cp/typeck.c 2013-05-13 19:34:15.000000000 +0000 7310 +++ gcc-4.8.1/gcc/cp/typeck.c 2013- 09-13 19:01:43.079865187+00008114 +++ gcc-4.8.1/gcc/cp/typeck.c 2013-10-01 16:06:43.968554286 +0000 7311 8115 @@ -8307,7 +8307,8 @@ 7312 8116 && TREE_CODE (retval) == VAR_DECL … … 7331 8135 diff -Naur gcc-4.8.1.orig/gcc/cp/typeck2.c gcc-4.8.1/gcc/cp/typeck2.c 7332 8136 --- gcc-4.8.1.orig/gcc/cp/typeck2.c 2013-04-11 16:05:02.000000000 +0000 7333 +++ gcc-4.8.1/gcc/cp/typeck2.c 2013- 09-13 19:01:43.076531862+00008137 +++ gcc-4.8.1/gcc/cp/typeck2.c 2013-10-01 16:06:43.964554286 +0000 7334 8138 @@ -262,7 +262,7 @@ 7335 8139 so that we can check again once it is completed. This makes sense … … 7343 8147 diff -Naur gcc-4.8.1.orig/gcc/doc/avr-mmcu.texi gcc-4.8.1/gcc/doc/avr-mmcu.texi 7344 8148 --- gcc-4.8.1.orig/gcc/doc/avr-mmcu.texi 2013-02-28 09:03:09.000000000 +0000 7345 +++ gcc-4.8.1/gcc/doc/avr-mmcu.texi 2013- 09-13 19:01:43.079865187+00008149 +++ gcc-4.8.1/gcc/doc/avr-mmcu.texi 2013-10-01 16:06:43.968554286 +0000 7346 8150 @@ -38,7 +38,7 @@ 7347 8151 … … 7355 8159 diff -Naur gcc-4.8.1.orig/gcc/doc/cpp.texi gcc-4.8.1/gcc/doc/cpp.texi 7356 8160 --- gcc-4.8.1.orig/gcc/doc/cpp.texi 2013-01-10 20:38:27.000000000 +0000 7357 +++ gcc-4.8.1/gcc/doc/cpp.texi 2013- 09-13 19:01:43.083198511+00008161 +++ gcc-4.8.1/gcc/doc/cpp.texi 2013-10-01 16:06:43.968554286 +0000 7358 8162 @@ -1926,11 +1926,9 @@ 7359 8163 This macro is defined when the C++ compiler is in use. You can use … … 7373 8177 diff -Naur gcc-4.8.1.orig/gcc/doc/extend.texi gcc-4.8.1/gcc/doc/extend.texi 7374 8178 --- gcc-4.8.1.orig/gcc/doc/extend.texi 2013-03-28 14:07:55.000000000 +0000 7375 +++ gcc-4.8.1/gcc/doc/extend.texi 2013-09-13 19:01:43.086531836 +0000 7376 @@ -8786,6 +8786,7 @@ 8179 +++ gcc-4.8.1/gcc/doc/extend.texi 2013-10-01 16:06:43.968554286 +0000 8180 @@ -7412,6 +7412,8 @@ 8181 the byte at @code{*@var{ptr}}. The byte is set to some implementation 8182 defined nonzero ``set'' value and the return value is @code{true} if and only 8183 if the previous contents were ``set''. 8184 +It should be only used for operands of type @code{bool} or @code{char}. For 8185 +other types only part of the value may be set. 8186 8187 All memory models are valid. 8188 8189 @@ -7421,6 +7423,10 @@ 8190 8191 This built-in function performs an atomic clear operation on 8192 @code{*@var{ptr}}. After the operation, @code{*@var{ptr}} contains 0. 8193 +It should be only used for operands of type @code{bool} or @code{char} and 8194 +in conjunction with @code{__atomic_test_and_set}. 8195 +For other types it may only clear partially. If the type is not @code{bool} 8196 +prefer using @code{__atomic_store}. 8197 8198 The valid memory model variants are 8199 @code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, and 8200 @@ -7492,18 +7498,20 @@ 8201 Memory model must be @code{__ATOMIC_RELEASE} or stronger. 8202 @end table 8203 8204 -When a lock acquire fails it's required for good performance to abort 8205 +When a lock acquire fails it is required for good performance to abort 8206 the transaction quickly. This can be done with a @code{_mm_pause} 8207 8208 @smallexample 8209 #include <immintrin.h> // For _mm_pause 8210 8211 +int lockvar; 8212 + 8213 /* Acquire lock with lock elision */ 8214 while (__atomic_exchange_n(&lockvar, 1, __ATOMIC_ACQUIRE|__ATOMIC_HLE_ACQUIRE)) 8215 _mm_pause(); /* Abort failed transaction */ 8216 ... 8217 /* Free lock with lock elision */ 8218 -__atomic_clear(&lockvar, __ATOMIC_RELEASE|__ATOMIC_HLE_RELEASE); 8219 +__atomic_store_n(&lockvar, 0, __ATOMIC_RELEASE|__ATOMIC_HLE_RELEASE); 8220 @end smallexample 8221 8222 @node Object Size Checking 8223 @@ -8786,6 +8794,7 @@ 7377 8224 * PowerPC Built-in Functions:: 7378 8225 * PowerPC AltiVec/VSX Built-in Functions:: … … 7382 8229 * SPARC VIS Built-in Functions:: 7383 8230 * SPU Built-in Functions:: 7384 @@ -14026,6 +140 27,120 @@8231 @@ -14026,6 +14035,120 @@ 7385 8232 Generates the @code{wait} machine instruction. 7386 8233 @end deftypefn … … 7503 8350 @subsection SH Built-in Functions 7504 8351 The following built-in functions are supported on the SH1, SH2, SH3 and SH4 8352 diff -Naur gcc-4.8.1.orig/gcc/doc/implement-cxx.texi gcc-4.8.1/gcc/doc/implement-cxx.texi 8353 --- gcc-4.8.1.orig/gcc/doc/implement-cxx.texi 2013-01-10 20:38:27.000000000 +0000 8354 +++ gcc-4.8.1/gcc/doc/implement-cxx.texi 2013-10-01 16:06:43.968554286 +0000 8355 @@ -9,8 +9,8 @@ 8356 A conforming implementation of ISO C++ is required to document its 8357 choice of behavior in each of the areas that are designated 8358 ``implementation defined''. The following lists all such areas, 8359 -along with the section numbers from the ISO/IEC 14822:1998 and ISO/IEC 8360 -14822:2003 standards. Some areas are only implementation-defined in 8361 +along with the section numbers from the ISO/IEC 14882:1998 and ISO/IEC 8362 +14882:2003 standards. Some areas are only implementation-defined in 8363 one version of the standard. 8364 8365 Some choices depend on the externally determined ABI for the platform 7505 8366 diff -Naur gcc-4.8.1.orig/gcc/doc/invoke.texi gcc-4.8.1/gcc/doc/invoke.texi 7506 8367 --- gcc-4.8.1.orig/gcc/doc/invoke.texi 2013-03-29 13:41:29.000000000 +0000 7507 +++ gcc-4.8.1/gcc/doc/invoke.texi 2013- 09-13 19:01:43.093198485+00008368 +++ gcc-4.8.1/gcc/doc/invoke.texi 2013-10-01 16:06:43.972554286 +0000 7508 8369 @@ -13726,8 +13726,13 @@ 7509 8370 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction … … 7521 8382 7522 8383 @item k6 8384 diff -Naur gcc-4.8.1.orig/gcc/explow.c gcc-4.8.1/gcc/explow.c 8385 --- gcc-4.8.1.orig/gcc/explow.c 2013-01-10 20:38:27.000000000 +0000 8386 +++ gcc-4.8.1/gcc/explow.c 2013-10-01 16:06:43.972554286 +0000 8387 @@ -106,10 +106,10 @@ 8388 if (overflow) 8389 gcc_unreachable (); 8390 8391 - return immed_double_int_const (v, VOIDmode); 8392 + return immed_double_int_const (v, mode); 8393 } 8394 8395 - return GEN_INT (INTVAL (x) + c); 8396 + return gen_int_mode (INTVAL (x) + c, mode); 8397 8398 case CONST_DOUBLE: 8399 { 8400 @@ -124,7 +124,7 @@ 8401 To fix, add constant support wider than CONST_DOUBLE. */ 8402 gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_DOUBLE_INT); 8403 8404 - return immed_double_int_const (v, VOIDmode); 8405 + return immed_double_int_const (v, mode); 8406 } 8407 8408 case MEM: 8409 diff -Naur gcc-4.8.1.orig/gcc/expr.c gcc-4.8.1/gcc/expr.c 8410 --- gcc-4.8.1.orig/gcc/expr.c 2013-05-14 06:28:12.000000000 +0000 8411 +++ gcc-4.8.1/gcc/expr.c 2013-10-01 16:06:43.976554286 +0000 8412 @@ -119,7 +119,7 @@ 8413 int reverse; 8414 }; 8415 8416 -static void move_by_pieces_1 (rtx (*) (rtx, ...), enum machine_mode, 8417 +static void move_by_pieces_1 (insn_gen_fn, machine_mode, 8418 struct move_by_pieces_d *); 8419 static bool block_move_libcall_safe_for_call_parm (void); 8420 static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT); 8421 @@ -128,7 +128,7 @@ 8422 static rtx clear_by_pieces_1 (void *, HOST_WIDE_INT, enum machine_mode); 8423 static void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int); 8424 static void store_by_pieces_1 (struct store_by_pieces_d *, unsigned int); 8425 -static void store_by_pieces_2 (rtx (*) (rtx, ...), enum machine_mode, 8426 +static void store_by_pieces_2 (insn_gen_fn, machine_mode, 8427 struct store_by_pieces_d *); 8428 static tree clear_storage_libcall_fn (int); 8429 static rtx compress_float_constant (rtx, rtx); 8430 @@ -1043,7 +1043,7 @@ 8431 to make a move insn for that mode. DATA has all the other info. */ 8432 8433 static void 8434 -move_by_pieces_1 (rtx (*genfun) (rtx, ...), enum machine_mode mode, 8435 +move_by_pieces_1 (insn_gen_fn genfun, machine_mode mode, 8436 struct move_by_pieces_d *data) 8437 { 8438 unsigned int size = GET_MODE_SIZE (mode); 8439 @@ -2657,7 +2657,7 @@ 8440 to make a move insn for that mode. DATA has all the other info. */ 8441 8442 static void 8443 -store_by_pieces_2 (rtx (*genfun) (rtx, ...), enum machine_mode mode, 8444 +store_by_pieces_2 (insn_gen_fn genfun, machine_mode mode, 8445 struct store_by_pieces_d *data) 8446 { 8447 unsigned int size = GET_MODE_SIZE (mode); 7523 8448 diff -Naur gcc-4.8.1.orig/gcc/file-find.c gcc-4.8.1/gcc/file-find.c 7524 8449 --- gcc-4.8.1.orig/gcc/file-find.c 2013-01-10 20:38:27.000000000 +0000 7525 +++ gcc-4.8.1/gcc/file-find.c 2013- 09-13 19:01:43.093198485+00008450 +++ gcc-4.8.1/gcc/file-find.c 2013-10-01 16:06:43.976554286 +0000 7526 8451 @@ -31,7 +31,7 @@ 7527 8452 } … … 7571 8496 diff -Naur gcc-4.8.1.orig/gcc/file-find.h gcc-4.8.1/gcc/file-find.h 7572 8497 --- gcc-4.8.1.orig/gcc/file-find.h 2013-01-10 20:38:27.000000000 +0000 7573 +++ gcc-4.8.1/gcc/file-find.h 2013- 09-13 19:01:43.096531810+00008498 +++ gcc-4.8.1/gcc/file-find.h 2013-10-01 16:06:43.976554286 +0000 7574 8499 @@ -38,7 +38,7 @@ 7575 8500 }; … … 7581 8506 extern void prefix_from_env (const char *, struct path_prefix *); 7582 8507 extern void prefix_from_string (const char *, struct path_prefix *); 8508 diff -Naur gcc-4.8.1.orig/gcc/fold-const.c gcc-4.8.1/gcc/fold-const.c 8509 --- gcc-4.8.1.orig/gcc/fold-const.c 2013-05-17 08:52:36.000000000 +0000 8510 +++ gcc-4.8.1/gcc/fold-const.c 2013-10-01 16:06:43.976554286 +0000 8511 @@ -469,11 +469,24 @@ 8512 and actually traps on some architectures. But if overflow is 8513 undefined, we can negate, because - (INT_MIN / 1) is an 8514 overflow. */ 8515 - if (INTEGRAL_TYPE_P (TREE_TYPE (t)) 8516 - && !TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t))) 8517 - break; 8518 - return negate_expr_p (TREE_OPERAND (t, 1)) 8519 - || negate_expr_p (TREE_OPERAND (t, 0)); 8520 + if (INTEGRAL_TYPE_P (TREE_TYPE (t))) 8521 + { 8522 + if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (t))) 8523 + break; 8524 + /* If overflow is undefined then we have to be careful because 8525 + we ask whether it's ok to associate the negate with the 8526 + division which is not ok for example for 8527 + -((a - b) / c) where (-(a - b)) / c may invoke undefined 8528 + overflow because of negating INT_MIN. So do not use 8529 + negate_expr_p here but open-code the two important cases. */ 8530 + if (TREE_CODE (TREE_OPERAND (t, 0)) == NEGATE_EXPR 8531 + || (TREE_CODE (TREE_OPERAND (t, 0)) == INTEGER_CST 8532 + && may_negate_without_overflow_p (TREE_OPERAND (t, 0)))) 8533 + return true; 8534 + } 8535 + else if (negate_expr_p (TREE_OPERAND (t, 0))) 8536 + return true; 8537 + return negate_expr_p (TREE_OPERAND (t, 1)); 8538 8539 case NOP_EXPR: 8540 /* Negate -((double)float) as (double)(-float). */ 8541 @@ -653,16 +666,20 @@ 8542 return fold_build2_loc (loc, TREE_CODE (t), type, 8543 TREE_OPERAND (t, 0), negate_expr (tem)); 8544 } 8545 + /* If overflow is undefined then we have to be careful because 8546 + we ask whether it's ok to associate the negate with the 8547 + division which is not ok for example for 8548 + -((a - b) / c) where (-(a - b)) / c may invoke undefined 8549 + overflow because of negating INT_MIN. So do not use 8550 + negate_expr_p here but open-code the two important cases. */ 8551 tem = TREE_OPERAND (t, 0); 8552 - if (negate_expr_p (tem)) 8553 - { 8554 - if (INTEGRAL_TYPE_P (type) 8555 - && (TREE_CODE (tem) != INTEGER_CST 8556 - || tree_int_cst_equal (tem, TYPE_MIN_VALUE (type)))) 8557 - fold_overflow_warning (warnmsg, WARN_STRICT_OVERFLOW_MISC); 8558 - return fold_build2_loc (loc, TREE_CODE (t), type, 8559 - negate_expr (tem), TREE_OPERAND (t, 1)); 8560 - } 8561 + if ((INTEGRAL_TYPE_P (type) 8562 + && (TREE_CODE (tem) == NEGATE_EXPR 8563 + || (TREE_CODE (tem) == INTEGER_CST 8564 + && may_negate_without_overflow_p (tem)))) 8565 + || !INTEGRAL_TYPE_P (type)) 8566 + return fold_build2_loc (loc, TREE_CODE (t), type, 8567 + negate_expr (tem), TREE_OPERAND (t, 1)); 8568 } 8569 break; 8570 8571 @@ -4220,7 +4237,7 @@ 8572 } 8573 8574 if (low == 0 && high == 0) 8575 - return build_int_cst (type, 1); 8576 + return omit_one_operand_loc (loc, type, build_int_cst (type, 1), exp); 8577 8578 if (low == 0) 8579 return fold_build2_loc (loc, LE_EXPR, type, exp, 8580 @@ -9851,6 +9868,24 @@ 8581 } 8582 } 8583 8584 +/* Mask out the tz least significant bits of X of type TYPE where 8585 + tz is the number of trailing zeroes in Y. */ 8586 +static double_int 8587 +mask_with_tz (tree type, double_int x, double_int y) 8588 +{ 8589 + int tz = y.trailing_zeros (); 8590 + 8591 + if (tz > 0) 8592 + { 8593 + double_int mask; 8594 + 8595 + mask = ~double_int::mask (tz); 8596 + mask = mask.ext (TYPE_PRECISION (type), TYPE_UNSIGNED (type)); 8597 + return mask & x; 8598 + } 8599 + return x; 8600 +} 8601 + 8602 /* Fold a binary expression of code CODE and type TYPE with operands 8603 OP0 and OP1. LOC is the location of the resulting expression. 8604 Return the folded expression if folding is successful. Otherwise, 8605 @@ -11175,6 +11210,8 @@ 8606 { 8607 double_int c1, c2, c3, msk; 8608 int width = TYPE_PRECISION (type), w; 8609 + bool try_simplify = true; 8610 + 8611 c1 = tree_to_double_int (TREE_OPERAND (arg0, 1)); 8612 c2 = tree_to_double_int (arg1); 8613 8614 @@ -11209,7 +11246,21 @@ 8615 break; 8616 } 8617 } 8618 - if (c3 != c1) 8619 + 8620 + /* If X is a tree of the form (Y * K1) & K2, this might conflict 8621 + with that optimization from the BIT_AND_EXPR optimizations. 8622 + This could end up in an infinite recursion. */ 8623 + if (TREE_CODE (TREE_OPERAND (arg0, 0)) == MULT_EXPR 8624 + && TREE_CODE (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1)) 8625 + == INTEGER_CST) 8626 + { 8627 + tree t = TREE_OPERAND (TREE_OPERAND (arg0, 0), 1); 8628 + double_int masked = mask_with_tz (type, c3, tree_to_double_int (t)); 8629 + 8630 + try_simplify = (masked != c1); 8631 + } 8632 + 8633 + if (try_simplify && c3 != c1) 8634 return fold_build2_loc (loc, BIT_IOR_EXPR, type, 8635 fold_build2_loc (loc, BIT_AND_EXPR, type, 8636 TREE_OPERAND (arg0, 0), 8637 @@ -11599,22 +11650,16 @@ 8638 && TREE_CODE (arg0) == MULT_EXPR 8639 && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST) 8640 { 8641 - int arg1tz 8642 - = tree_to_double_int (TREE_OPERAND (arg0, 1)).trailing_zeros (); 8643 - if (arg1tz > 0) 8644 - { 8645 - double_int arg1mask, masked; 8646 - arg1mask = ~double_int::mask (arg1tz); 8647 - arg1mask = arg1mask.ext (TYPE_PRECISION (type), 8648 - TYPE_UNSIGNED (type)); 8649 - masked = arg1mask & tree_to_double_int (arg1); 8650 - if (masked.is_zero ()) 8651 - return omit_two_operands_loc (loc, type, build_zero_cst (type), 8652 - arg0, arg1); 8653 - else if (masked != tree_to_double_int (arg1)) 8654 - return fold_build2_loc (loc, code, type, op0, 8655 - double_int_to_tree (type, masked)); 8656 - } 8657 + double_int masked 8658 + = mask_with_tz (type, tree_to_double_int (arg1), 8659 + tree_to_double_int (TREE_OPERAND (arg0, 1))); 8660 + 8661 + if (masked.is_zero ()) 8662 + return omit_two_operands_loc (loc, type, build_zero_cst (type), 8663 + arg0, arg1); 8664 + else if (masked != tree_to_double_int (arg1)) 8665 + return fold_build2_loc (loc, code, type, op0, 8666 + double_int_to_tree (type, masked)); 8667 } 8668 8669 /* For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M, 8670 @@ -14040,14 +14085,29 @@ 8671 && integer_zerop (op2) 8672 && (tem = sign_bit_p (TREE_OPERAND (arg0, 0), arg1))) 8673 { 8674 + /* sign_bit_p looks through both zero and sign extensions, 8675 + but for this optimization only sign extensions are 8676 + usable. */ 8677 + tree tem2 = TREE_OPERAND (arg0, 0); 8678 + while (tem != tem2) 8679 + { 8680 + if (TREE_CODE (tem2) != NOP_EXPR 8681 + || TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (tem2, 0)))) 8682 + { 8683 + tem = NULL_TREE; 8684 + break; 8685 + } 8686 + tem2 = TREE_OPERAND (tem2, 0); 8687 + } 8688 /* sign_bit_p only checks ARG1 bits within A's precision. 8689 If <sign bit of A> has wider type than A, bits outside 8690 of A's precision in <sign bit of A> need to be checked. 8691 If they are all 0, this optimization needs to be done 8692 in unsigned A's type, if they are all 1 in signed A's type, 8693 otherwise this can't be done. */ 8694 - if (TYPE_PRECISION (TREE_TYPE (tem)) 8695 - < TYPE_PRECISION (TREE_TYPE (arg1)) 8696 + if (tem 8697 + && TYPE_PRECISION (TREE_TYPE (tem)) 8698 + < TYPE_PRECISION (TREE_TYPE (arg1)) 8699 && TYPE_PRECISION (TREE_TYPE (tem)) 8700 < TYPE_PRECISION (type)) 8701 { 7583 8702 diff -Naur gcc-4.8.1.orig/gcc/fortran/interface.c gcc-4.8.1/gcc/fortran/interface.c 7584 8703 --- gcc-4.8.1.orig/gcc/fortran/interface.c 2013-04-26 19:20:55.000000000 +0000 7585 +++ gcc-4.8.1/gcc/fortran/interface.c 2013- 09-13 19:01:43.096531810+00008704 +++ gcc-4.8.1/gcc/fortran/interface.c 2013-10-01 16:06:43.976554286 +0000 7586 8705 @@ -1024,7 +1024,8 @@ 7587 8706 bool type_must_agree, char *errmsg, int err_len) … … 7596 8715 diff -Naur gcc-4.8.1.orig/gcc/fortran/match.c gcc-4.8.1/gcc/fortran/match.c 7597 8716 --- gcc-4.8.1.orig/gcc/fortran/match.c 2013-04-18 18:20:22.000000000 +0000 7598 +++ gcc-4.8.1/gcc/fortran/match.c 2013- 09-13 19:01:43.099865134+00008717 +++ gcc-4.8.1/gcc/fortran/match.c 2013-10-01 16:06:43.980554285 +0000 7599 8718 @@ -5142,7 +5142,6 @@ 7600 8719 { … … 7674 8793 diff -Naur gcc-4.8.1.orig/gcc/fortran/module.c gcc-4.8.1/gcc/fortran/module.c 7675 8794 --- gcc-4.8.1.orig/gcc/fortran/module.c 2013-01-29 21:40:51.000000000 +0000 7676 +++ gcc-4.8.1/gcc/fortran/module.c 2013- 09-13 19:01:43.099865134+00008795 +++ gcc-4.8.1/gcc/fortran/module.c 2013-10-01 16:06:43.980554285 +0000 7677 8796 @@ -4465,7 +4465,7 @@ 7678 8797 module_locus locus; … … 7686 8805 diff -Naur gcc-4.8.1.orig/gcc/fortran/resolve.c gcc-4.8.1/gcc/fortran/resolve.c 7687 8806 --- gcc-4.8.1.orig/gcc/fortran/resolve.c 2013-05-07 16:36:48.000000000 +0000 7688 +++ gcc-4.8.1/gcc/fortran/resolve.c 2013- 09-13 19:01:43.103198459+00008807 +++ gcc-4.8.1/gcc/fortran/resolve.c 2013-10-01 16:06:43.980554285 +0000 7689 8808 @@ -9746,6 +9746,10 @@ 7690 8809 … … 7708 8827 diff -Naur gcc-4.8.1.orig/gcc/fortran/simplify.c gcc-4.8.1/gcc/fortran/simplify.c 7709 8828 --- gcc-4.8.1.orig/gcc/fortran/simplify.c 2013-05-07 16:36:48.000000000 +0000 7710 +++ gcc-4.8.1/gcc/fortran/simplify.c 2013- 09-13 19:01:43.106531784+00008829 +++ gcc-4.8.1/gcc/fortran/simplify.c 2013-10-01 16:06:43.980554285 +0000 7711 8830 @@ -332,13 +332,15 @@ 7712 8831 } … … 7763 8882 diff -Naur gcc-4.8.1.orig/gcc/fortran/trans-array.c gcc-4.8.1/gcc/fortran/trans-array.c 7764 8883 --- gcc-4.8.1.orig/gcc/fortran/trans-array.c 2013-02-21 12:26:44.000000000 +0000 7765 +++ gcc-4.8.1/gcc/fortran/trans-array.c 2013- 09-13 19:01:43.109865108+00008884 +++ gcc-4.8.1/gcc/fortran/trans-array.c 2013-10-01 16:06:43.984554285 +0000 7766 8885 @@ -3674,7 +3674,7 @@ 7767 8886 /* Calculate the lower bound of an array section. */ … … 7900 9019 diff -Naur gcc-4.8.1.orig/gcc/fortran/trans-intrinsic.c gcc-4.8.1/gcc/fortran/trans-intrinsic.c 7901 9020 --- gcc-4.8.1.orig/gcc/fortran/trans-intrinsic.c 2013-03-15 10:09:39.000000000 +0000 7902 +++ gcc-4.8.1/gcc/fortran/trans-intrinsic.c 2013- 09-13 19:01:43.113198433+00009021 +++ gcc-4.8.1/gcc/fortran/trans-intrinsic.c 2013-10-01 16:06:43.984554285 +0000 7903 9022 @@ -5653,8 +5653,7 @@ 7904 9023 … … 7927 9046 diff -Naur gcc-4.8.1.orig/gcc/gcc-ar.c gcc-4.8.1/gcc/gcc-ar.c 7928 9047 --- gcc-4.8.1.orig/gcc/gcc-ar.c 2013-01-10 20:38:27.000000000 +0000 7929 +++ gcc-4.8.1/gcc/gcc-ar.c 2013- 09-13 19:01:43.113198433+00009048 +++ gcc-4.8.1/gcc/gcc-ar.c 2013-10-01 16:06:43.984554285 +0000 7930 9049 @@ -136,7 +136,7 @@ 7931 9050 setup_prefixes (av[0]); … … 7968 9087 7969 9088 /* Create new command line with plugin */ 9089 diff -Naur gcc-4.8.1.orig/gcc/genoutput.c gcc-4.8.1/gcc/genoutput.c 9090 --- gcc-4.8.1.orig/gcc/genoutput.c 2013-01-10 20:38:27.000000000 +0000 9091 +++ gcc-4.8.1/gcc/genoutput.c 2013-10-01 16:06:43.984554285 +0000 9092 @@ -404,9 +404,9 @@ 9093 } 9094 9095 if (d->name && d->name[0] != '*') 9096 - printf (" (insn_gen_fn) gen_%s,\n", d->name); 9097 + printf (" { (insn_gen_fn::stored_funcptr) gen_%s },\n", d->name); 9098 else 9099 - printf (" 0,\n"); 9100 + printf (" { 0 },\n"); 9101 9102 printf (" &operand_data[%d],\n", d->operand_number); 9103 printf (" %d,\n", d->n_generator_args); 7970 9104 diff -Naur gcc-4.8.1.orig/gcc/gimple-ssa-strength-reduction.c gcc-4.8.1/gcc/gimple-ssa-strength-reduction.c 7971 9105 --- gcc-4.8.1.orig/gcc/gimple-ssa-strength-reduction.c 2013-04-15 15:00:06.000000000 +0000 7972 +++ gcc-4.8.1/gcc/gimple-ssa-strength-reduction.c 2013- 09-13 19:01:43.116531757+00009106 +++ gcc-4.8.1/gcc/gimple-ssa-strength-reduction.c 2013-10-01 16:06:43.984554285 +0000 7973 9107 @@ -1525,11 +1525,23 @@ 7974 9108 static void … … 8002 9136 diff -Naur gcc-4.8.1.orig/gcc/gimple.c gcc-4.8.1/gcc/gimple.c 8003 9137 --- gcc-4.8.1.orig/gcc/gimple.c 2013-01-10 20:38:27.000000000 +0000 8004 +++ gcc-4.8.1/gcc/gimple.c 2013- 09-13 19:01:43.113198433+00009138 +++ gcc-4.8.1/gcc/gimple.c 2013-10-01 16:06:43.984554285 +0000 8005 9139 @@ -4045,6 +4045,13 @@ 8006 9140 ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); … … 8019 9153 diff -Naur gcc-4.8.1.orig/gcc/go/go-gcc.cc gcc-4.8.1/gcc/go/go-gcc.cc 8020 9154 --- gcc-4.8.1.orig/gcc/go/go-gcc.cc 2013-01-10 20:38:27.000000000 +0000 8021 +++ gcc-4.8.1/gcc/go/go-gcc.cc 2013-09-13 19:01:43.166531626 +0000 8022 @@ -287,10 +287,10 @@ 9155 +++ gcc-4.8.1/gcc/go/go-gcc.cc 2013-10-01 16:06:43.992554285 +0000 9156 @@ -208,6 +208,16 @@ 9157 Bexpression* 9158 zero_expression(Btype*); 9159 9160 + Bexpression* 9161 + error_expression() 9162 + { return this->make_expression(error_mark_node); } 9163 + 9164 + Bexpression* 9165 + var_expression(Bvariable* var, Location); 9166 + 9167 + Bexpression* 9168 + indirect_expression(Bexpression* expr, bool known_valid, Location); 9169 + 9170 // Statements. 9171 9172 Bstatement* 9173 @@ -287,10 +297,10 @@ 8023 9174 Location, Bstatement**); 8024 9175 … … 8033 9184 8034 9185 Bvariable* 8035 @@ -1242,20 +1242,41 @@ 9186 @@ -848,6 +858,30 @@ 9187 return tree_to_expr(ret); 9188 } 9189 9190 +// An expression that references a variable. 9191 + 9192 +Bexpression* 9193 +Gcc_backend::var_expression(Bvariable* var, Location) 9194 +{ 9195 + tree ret = var->get_tree(); 9196 + if (ret == error_mark_node) 9197 + return this->error_expression(); 9198 + return tree_to_expr(ret); 9199 +} 9200 + 9201 +// An expression that indirectly references an expression. 9202 + 9203 +Bexpression* 9204 +Gcc_backend::indirect_expression(Bexpression* expr, bool known_valid, 9205 + Location location) 9206 +{ 9207 + tree ret = build_fold_indirect_ref_loc(location.gcc_location(), 9208 + expr->get_tree()); 9209 + if (known_valid) 9210 + TREE_THIS_NOTRAP(ret) = 1; 9211 + return tree_to_expr(ret); 9212 +} 9213 + 9214 // An expression as a statement. 9215 9216 Bstatement* 9217 @@ -1242,20 +1276,41 @@ 8036 9218 switch (TREE_CODE(type)) 8037 9219 { … … 8089 9271 case ARRAY_TYPE: 8090 9272 { 8091 @@ -1454,8 +1 475,8 @@9273 @@ -1454,8 +1509,8 @@ 8092 9274 // Create a named immutable initialized data structure. 8093 9275 … … 8095 9277 -Gcc_backend::immutable_struct(const std::string& name, bool, Btype* btype, 8096 9278 - Location location) 8097 +Gcc_backend::immutable_struct(const std::string& name, bool , bool,8098 + Btype* btype, Location location)9279 +Gcc_backend::immutable_struct(const std::string& name, bool is_hidden, 9280 + bool, Btype* btype, Location location) 8099 9281 { 8100 9282 tree type_tree = btype->get_tree(); 8101 9283 if (type_tree == error_mark_node) 8102 @@ -1482,7 +1503,7 @@ 9284 @@ -1469,6 +1524,8 @@ 9285 TREE_CONSTANT(decl) = 1; 9286 TREE_USED(decl) = 1; 9287 DECL_ARTIFICIAL(decl) = 1; 9288 + if (!is_hidden) 9289 + TREE_PUBLIC(decl) = 1; 9290 9291 // We don't call rest_of_decl_compilation until we have the 9292 // initializer. 9293 @@ -1482,8 +1539,7 @@ 8103 9294 8104 9295 void 8105 9296 Gcc_backend::immutable_struct_set_init(Bvariable* var, const std::string&, 8106 9297 - bool is_common, Btype*, 8107 + bool is_hidden, bool is_common, Btype*,8108 9298 - Location, 9299 + bool, bool is_common, Btype*, Location, 8109 9300 Bexpression* initializer) 8110 9301 { 8111 @@ -1495,12 +1516,18 @@ 9302 tree decl = var->get_tree(); 9303 @@ -1494,13 +1550,14 @@ 9304 DECL_INITIAL(decl) = init_tree; 8112 9305 8113 9306 // We can't call make_decl_one_only until we set DECL_INITIAL. 8114 9307 - if (!is_common) 8115 9308 - TREE_PUBLIC(decl) = 1; 8116 9309 - else 8117 9310 - { 8118 9311 - make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); 8119 9312 - resolve_unique_section(decl, 1, 0); 8120 + if (!is_hidden) 8121 + TREE_PUBLIC(decl) = 1; 8122 } 8123 + else 9313 - } 9314 + if (is_common) 8124 9315 + make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl)); 8125 9316 + … … 8134 9325 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/backend.h gcc-4.8.1/gcc/go/gofrontend/backend.h 8135 9326 --- gcc-4.8.1.orig/gcc/go/gofrontend/backend.h 2012-11-29 18:11:17.000000000 +0000 8136 +++ gcc-4.8.1/gcc/go/gofrontend/backend.h 2013- 09-13 19:01:43.116531757+00009327 +++ gcc-4.8.1/gcc/go/gofrontend/backend.h 2013-10-01 16:06:43.984554285 +0000 8137 9328 @@ -95,7 +95,10 @@ 8138 9329 … … 8147 9338 function_type(const Btyped_identifier& receiver, 8148 9339 const std::vector<Btyped_identifier>& parameters, 8149 @@ -388,18 +391,22 @@ 9340 @@ -228,6 +231,22 @@ 9341 virtual Bexpression* 9342 zero_expression(Btype*) = 0; 9343 9344 + // Create an error expression. This is used for cases which should 9345 + // not occur in a correct program, in order to keep the compilation 9346 + // going without crashing. 9347 + virtual Bexpression* 9348 + error_expression() = 0; 9349 + 9350 + // Create a reference to a variable. 9351 + virtual Bexpression* 9352 + var_expression(Bvariable* var, Location) = 0; 9353 + 9354 + // Create an expression that indirects through the pointer expression EXPR 9355 + // (i.e., return the expression for *EXPR). KNOWN_VALID is true if the pointer 9356 + // is known to point to a valid memory location. 9357 + virtual Bexpression* 9358 + indirect_expression(Bexpression* expr, bool known_valid, Location) = 0; 9359 + 9360 // Statements. 9361 9362 // Create an error statement. This is used for cases which should 9363 @@ -388,18 +407,22 @@ 8150 9364 Bstatement** pstatement) = 0; 8151 9365 … … 8174 9388 // TYPE will be a struct type; the type of the returned expression 8175 9389 // must be a pointer to this struct type. 8176 @@ -409,20 +4 16,20 @@9390 @@ -409,20 +432,20 @@ 8177 9391 // address. After calling this the frontend will call 8178 9392 // immutable_struct_set_init. … … 8206 9420 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/expressions.cc gcc-4.8.1/gcc/go/gofrontend/expressions.cc 8207 9421 --- gcc-4.8.1.orig/gcc/go/gofrontend/expressions.cc 2012-12-21 15:59:27.000000000 +0000 8208 +++ gcc-4.8.1/gcc/go/gofrontend/expressions.cc 2013-09-13 19:01:43.119865082 +0000 8209 @@ -1090,6 +1090,15 @@ 9422 +++ gcc-4.8.1/gcc/go/gofrontend/expressions.cc 2013-10-01 16:06:43.988554285 +0000 9423 @@ -978,22 +978,19 @@ 9424 { 9425 Bvariable* bvar = this->variable_->get_backend_variable(context->gogo(), 9426 context->function()); 9427 - tree ret = var_to_tree(bvar); 9428 - if (ret == error_mark_node) 9429 - return error_mark_node; 9430 bool is_in_heap; 9431 + Location loc = this->location(); 9432 if (this->variable_->is_variable()) 9433 is_in_heap = this->variable_->var_value()->is_in_heap(); 9434 else if (this->variable_->is_result_variable()) 9435 is_in_heap = this->variable_->result_var_value()->is_in_heap(); 9436 else 9437 go_unreachable(); 9438 + 9439 + Bexpression* ret = context->backend()->var_expression(bvar, loc); 9440 if (is_in_heap) 9441 - { 9442 - ret = build_fold_indirect_ref_loc(this->location().gcc_location(), ret); 9443 - TREE_THIS_NOTRAP(ret) = 1; 9444 - } 9445 - return ret; 9446 + ret = context->backend()->indirect_expression(ret, true, loc); 9447 + return expr_to_tree(ret); 9448 } 9449 9450 // Ast dump for variable expression. 9451 @@ -1090,6 +1087,15 @@ 8210 9452 return this->statement_->type(); 8211 9453 } … … 8223 9465 8224 9466 void 8225 @@ -1255,17 +126 4,16 @@9467 @@ -1255,17 +1261,16 @@ 8226 9468 go_unreachable(); 8227 9469 } … … 8247 9489 go_unreachable(); 8248 9490 8249 @@ -1273,14 +12 81,12 @@9491 @@ -1273,14 +1278,12 @@ 8250 9492 // can't take their address. 8251 9493 if (fntype->is_builtin()) … … 8264 9506 if (id == error_mark_node) 8265 9507 return error_mark_node; 8266 @@ -1296,46 +1 302,55 @@9508 @@ -1296,46 +1299,55 @@ 8267 9509 if (fndecl == error_mark_node) 8268 9510 return error_mark_node; … … 8349 9591 8350 9592 // Ast dump for function. 8351 @@ -1361,6 +137 6,197@@9593 @@ -1361,6 +1373,181 @@ 8352 9594 return new Func_expression(function, closure, location); 8353 9595 } … … 8359 9601 +Func_descriptor_expression::Func_descriptor_expression(Named_object* fn) 8360 9602 + : Expression(EXPRESSION_FUNC_DESCRIPTOR, fn->location()), 8361 + fn_(fn), d fn_(NULL), dvar_(NULL)9603 + fn_(fn), dvar_(NULL) 8362 9604 +{ 8363 9605 + go_assert(!fn->is_function() || !fn->func_value()->needs_closure()); … … 8394 9636 +} 8395 9637 + 8396 +// Copy a Func_descriptor_expression;8397 +8398 +Expression*8399 +Func_descriptor_expression::do_copy()8400 +{8401 + Func_descriptor_expression* fde =8402 + Expression::make_func_descriptor(this->fn_);8403 + if (this->dfn_ != NULL)8404 + fde->set_descriptor_wrapper(this->dfn_);8405 + return fde;8406 +}8407 +8408 9638 +// The tree for a function descriptor. 8409 9639 + … … 8432 9662 + if (no->package() != NULL 8433 9663 + || Linemap::is_predeclared_location(no->location())) 8434 + { 8435 + bvar = context->backend()->immutable_struct_reference(var_name, btype, 8436 + loc); 8437 + go_assert(this->dfn_ == NULL); 8438 + } 9664 + bvar = context->backend()->immutable_struct_reference(var_name, btype, 9665 + loc); 8439 9666 + else 8440 9667 + { … … 8446 9673 + btype, bloc); 8447 9674 + Expression_list* vals = new Expression_list(); 8448 + go_assert(this->dfn_ != NULL); 8449 + vals->push_back(Expression::make_func_code_reference(this->dfn_, bloc)); 9675 + vals->push_back(Expression::make_func_code_reference(this->fn_, bloc)); 8450 9676 + Expression* init = 8451 9677 + Expression::make_struct_composite_literal(this->type(), vals, bloc); … … 8547 9773 8548 9774 // Return the name of an unknown expression. 8549 @@ -5462,6 +56 68,7 @@9775 @@ -5462,6 +5649,7 @@ 8550 9776 if (tleft->is_abstract() 8551 9777 && subcontext.type != NULL … … 8555 9781 this->report_error(("invalid context-determined non-integer type " 8556 9782 "for left operand of shift")); 8557 @@ -5641,6 +58 48,20 @@9783 @@ -5641,6 +5829,20 @@ 8558 9784 this->set_is_error(); 8559 9785 return; … … 8576 9802 else 8577 9803 { 8578 @@ -6429,20 +66 50,49 @@9804 @@ -6429,20 +6631,49 @@ 8579 9805 return Expression::traverse(&this->expr_, traverse); 8580 9806 } … … 8633 9859 8634 9860 // Determine the types of a method expression. 8635 @@ -6450,7 +6 700,14 @@9861 @@ -6450,7 +6681,14 @@ 8636 9862 void 8637 9863 Bound_method_expression::do_determine_type(const Type_context*) … … 8649 9875 this->expr_->determine_type_no_context(); 8650 9876 else 8651 @@ -6465,31 +67 22,278 @@9877 @@ -6465,31 +6703,278 @@ 8652 9878 void 8653 9879 Bound_method_expression::do_check_types(Gogo*) … … 8668 9894 + else if (fn->is_function_declaration()) 8669 9895 + fntype = fn->func_declaration_value()->type(); 8670 9896 + else 8671 9897 + go_unreachable(); 8672 9898 + Type* rtype = fntype->receiver()->type()->deref(); … … 8703 9929 + Bound_method_expression::method_value_thunks.insert(val); 8704 9930 + if (!ins.second) 9931 + { 9932 + // We have seen this method before. 9933 + go_assert(ins.first->second != NULL); 9934 + return ins.first->second; 9935 + } 9936 + 9937 + Location loc = fn->location(); 9938 + 9939 + Function_type* orig_fntype; 9940 + if (fn->is_function()) 9941 + orig_fntype = fn->func_value()->type(); 9942 + else if (fn->is_function_declaration()) 9943 + orig_fntype = fn->func_declaration_value()->type(); 9944 + else 9945 + orig_fntype = NULL; 9946 + 9947 + if (orig_fntype == NULL || !orig_fntype->is_method()) 9948 + { 9949 + ins.first->second = Named_object::make_erroneous_name(Gogo::thunk_name()); 9950 + return ins.first->second; 9951 + } 9952 + 9953 + Struct_field_list* sfl = new Struct_field_list(); 9954 + // The type here is wrong--it should be the C function type. But it 9955 + // doesn't really matter. 9956 + Type* vt = Type::make_pointer_type(Type::make_void_type()); 9957 + sfl->push_back(Struct_field(Typed_identifier("fn.0", vt, loc))); 9958 + sfl->push_back(Struct_field(Typed_identifier("val.1", 9959 + orig_fntype->receiver()->type(), 9960 + loc))); 9961 + Type* closure_type = Type::make_struct_type(sfl, loc); 9962 + closure_type = Type::make_pointer_type(closure_type); 9963 + 9964 + Function_type* new_fntype = orig_fntype->copy_with_names(); 9965 + 9966 + Named_object* new_no = gogo->start_function(Gogo::thunk_name(), new_fntype, 9967 + false, loc); 9968 + 9969 + Variable* cvar = new Variable(closure_type, NULL, false, false, false, loc); 9970 + cvar->set_is_used(); 9971 + Named_object* cp = Named_object::make_variable("$closure", NULL, cvar); 9972 + new_no->func_value()->set_closure_var(cp); 9973 + 9974 + gogo->start_block(loc); 9975 + 9976 + // Field 0 of the closure is the function code pointer, field 1 is 9977 + // the value on which to invoke the method. 9978 + Expression* arg = Expression::make_var_reference(cp, loc); 9979 + arg = Expression::make_unary(OPERATOR_MULT, arg, loc); 9980 + arg = Expression::make_field_reference(arg, 1, loc); 9981 + 9982 + Expression* bme = Expression::make_bound_method(arg, method, fn, loc); 9983 + 9984 + const Typed_identifier_list* orig_params = orig_fntype->parameters(); 9985 + Expression_list* args; 9986 + if (orig_params == NULL || orig_params->empty()) 9987 + args = NULL; 9988 else 8705 9989 { 8706 9990 - Type* rtype = this->type()->function_type()->receiver()->type()->deref(); … … 8711 9995 - if (!Type::are_identical(rtype, etype, true, NULL)) 8712 9996 - this->report_error(_("method type does not match object type")); 8713 + // We have seen this method before.8714 + go_assert(ins.first->second != NULL);8715 + return ins.first->second;8716 }8717 +8718 + Location loc = fn->location();8719 +8720 + Function_type* orig_fntype;8721 + if (fn->is_function())8722 + orig_fntype = fn->func_value()->type();8723 + else if (fn->is_function_declaration())8724 + orig_fntype = fn->func_declaration_value()->type();8725 + else8726 + orig_fntype = NULL;8727 +8728 + if (orig_fntype == NULL || !orig_fntype->is_method())8729 + {8730 + ins.first->second = Named_object::make_erroneous_name(Gogo::thunk_name());8731 + return ins.first->second;8732 + }8733 +8734 + Struct_field_list* sfl = new Struct_field_list();8735 + // The type here is wrong--it should be new_fntype. But we don't8736 + // have new_fntype yet, and it doesn't really matter.8737 + Type* vt = Type::make_pointer_type(Type::make_void_type());8738 + sfl->push_back(Struct_field(Typed_identifier("fn.0", vt, loc)));8739 + sfl->push_back(Struct_field(Typed_identifier("val.1",8740 + orig_fntype->receiver()->type(),8741 + loc)));8742 + Type* closure_type = Type::make_struct_type(sfl, loc);8743 + closure_type = Type::make_pointer_type(closure_type);8744 +8745 + Function_type* new_fntype = orig_fntype->copy_with_closure(closure_type);8746 +8747 + Named_object* new_no = gogo->start_function(Gogo::thunk_name(), new_fntype,8748 + false, loc);8749 +8750 + gogo->start_block(loc);8751 +8752 + Named_object* cp = gogo->lookup("closure.0", NULL);8753 + go_assert(cp != NULL8754 + && cp->is_variable()8755 + && cp->var_value()->is_parameter());8756 +8757 + // Field 0 of the closure is the function code pointer, field 1 is8758 + // the value on which to invoke the method.8759 + Expression* arg = Expression::make_var_reference(cp, loc);8760 + arg = Expression::make_unary(OPERATOR_MULT, arg, loc);8761 + arg = Expression::make_field_reference(arg, 1, loc);8762 +8763 + Expression* bme = Expression::make_bound_method(arg, method, fn, loc);8764 +8765 + const Typed_identifier_list* orig_params = orig_fntype->parameters();8766 + Expression_list* args;8767 + if (orig_params == NULL || orig_params->empty())8768 + args = NULL;8769 + else8770 + {8771 9997 + const Typed_identifier_list* new_params = new_fntype->parameters(); 8772 9998 + args = new Expression_list(); 8773 9999 + for (Typed_identifier_list::const_iterator p = new_params->begin(); 8774 + p + 1!= new_params->end();10000 + p != new_params->end(); 8775 10001 + ++p) 8776 10002 + { … … 8781 10007 + args->push_back(Expression::make_var_reference(p_no, loc)); 8782 10008 + } 8783 +}10009 } 8784 10010 + 8785 10011 + Call_expression* call = Expression::make_call(bme, args, … … 8945 10171 8946 10172 // Dump ast representation of a bound method expression. 8947 @@ -6508,16 + 7012,16 @@10173 @@ -6508,16 +6993,16 @@ 8948 10174 ast_dump_context->ostream() << ")"; 8949 10175 } … … 8966 10192 8967 10193 // Class Builtin_call_expression. This is used for a call to a 8968 @@ -6722,6 +72 26,26 @@10194 @@ -6722,6 +7207,26 @@ 8969 10195 return Expression::make_error(loc); 8970 10196 } … … 8993 10219 { 8994 10220 Numeric_constant nc; 8995 @@ -6874,6 +73 98,8 @@10221 @@ -6874,6 +7379,8 @@ 8996 10222 Type* uintptr_type = Type::lookup_integer_type("uintptr"); 8997 10223 int uintptr_bits = uintptr_type->integer_type()->bits(); … … 9002 10228 Expression* len_arg; 9003 10229 if (parg == args->end()) 9004 @@ -6892,6 +7 418,7 @@10230 @@ -6892,6 +7399,7 @@ 9005 10231 else 9006 10232 { … … 9010 10236 return Expression::make_error(this->location()); 9011 10237 if (len_arg->type()->integer_type() != NULL 9012 @@ -6904,6 +74 31,7 @@10238 @@ -6904,6 +7412,7 @@ 9013 10239 if (is_slice && parg != args->end()) 9014 10240 { … … 9018 10244 return Expression::make_error(this->location()); 9019 10245 9020 @@ -7279,19 +7807,31 @@ 10246 @@ -7240,8 +7749,6 @@ 10247 return false; 10248 if (arg_type->is_abstract()) 10249 return false; 10250 - if (arg_type->named_type() != NULL) 10251 - arg_type->named_type()->convert(this->gogo_); 10252 10253 unsigned int ret; 10254 if (this->code_ == BUILTIN_SIZEOF) 10255 @@ -7279,19 +7786,31 @@ 9021 10256 Field_reference_expression* farg = arg->field_reference_expression(); 9022 10257 if (farg == NULL) … … 9062 10297 } 9063 10298 else if (this->code_ == BUILTIN_REAL || this->code_ == BUILTIN_IMAG) 9064 @@ -7509,6 +80 49,8 @@10299 @@ -7509,6 +8028,8 @@ 9065 10300 case BUILTIN_REAL: 9066 10301 case BUILTIN_IMAG: … … 9071 10306 break; 9072 10307 9073 @@ -7517,6 +80 59,8 @@10308 @@ -7517,6 +8038,8 @@ 9074 10309 // For the complex function the type of one operand can 9075 10310 // determine the type of the other, as in a binary expression. … … 9080 10315 { 9081 10316 Type* t1 = args->front()->type(); 9082 @@ -8509,6 +90 53,74 @@10317 @@ -8509,6 +9032,74 @@ 9083 10318 9084 10319 // Class Call_expression. … … 9155 10390 9156 10391 int 9157 @@ -8624,7 +9236,7 @@ 10392 @@ -8542,35 +9133,27 @@ 10393 // Because do_type will return an error type and thus prevent future 10394 // errors, check for that case now to ensure that the error gets 10395 // reported. 10396 - if (this->get_function_type() == NULL) 10397 + Function_type* fntype = this->get_function_type(); 10398 + if (fntype == NULL) 10399 { 10400 if (!this->fn_->type()->is_error()) 10401 this->report_error(_("expected function")); 10402 return Expression::make_error(loc); 10403 } 10404 10405 - // Recognize a call to a builtin function. 10406 - Func_expression* fne = this->fn_->func_expression(); 10407 - if (fne != NULL 10408 - && fne->named_object()->is_function_declaration() 10409 - && fne->named_object()->func_declaration_value()->type()->is_builtin()) 10410 - return new Builtin_call_expression(gogo, this->fn_, this->args_, 10411 - this->is_varargs_, loc); 10412 - 10413 // Handle an argument which is a call to a function which returns 10414 // multiple results. 10415 if (this->args_ != NULL 10416 && this->args_->size() == 1 10417 - && this->args_->front()->call_expression() != NULL 10418 - && this->fn_->type()->function_type() != NULL) 10419 + && this->args_->front()->call_expression() != NULL) 10420 { 10421 - Function_type* fntype = this->fn_->type()->function_type(); 10422 size_t rc = this->args_->front()->call_expression()->result_count(); 10423 if (rc > 1 10424 - && fntype->parameters() != NULL 10425 - && (fntype->parameters()->size() == rc 10426 - || (fntype->is_varargs() 10427 - && fntype->parameters()->size() - 1 <= rc))) 10428 + && ((fntype->parameters() != NULL 10429 + && (fntype->parameters()->size() == rc 10430 + || (fntype->is_varargs() 10431 + && fntype->parameters()->size() - 1 <= rc))) 10432 + || fntype->is_builtin())) 10433 { 10434 Call_expression* call = this->args_->front()->call_expression(); 10435 Expression_list* args = new Expression_list; 10436 @@ -8584,6 +9167,11 @@ 10437 } 10438 } 10439 10440 + // Recognize a call to a builtin function. 10441 + if (fntype->is_builtin()) 10442 + return new Builtin_call_expression(gogo, this->fn_, this->args_, 10443 + this->is_varargs_, loc); 10444 + 10445 // If this call returns multiple results, create a temporary 10446 // variable for each result. 10447 size_t rc = this->result_count(); 10448 @@ -8592,8 +9180,7 @@ 10449 std::vector<Temporary_statement*>* temps = 10450 new std::vector<Temporary_statement*>; 10451 temps->reserve(rc); 10452 - const Typed_identifier_list* results = 10453 - this->fn_->type()->function_type()->results(); 10454 + const Typed_identifier_list* results = fntype->results(); 10455 for (Typed_identifier_list::const_iterator p = results->begin(); 10456 p != results->end(); 10457 ++p) 10458 @@ -8608,10 +9195,8 @@ 10459 10460 // Handle a call to a varargs function by packaging up the extra 10461 // parameters. 10462 - if (this->fn_->type()->function_type() != NULL 10463 - && this->fn_->type()->function_type()->is_varargs()) 10464 + if (fntype->is_varargs()) 10465 { 10466 - Function_type* fntype = this->fn_->type()->function_type(); 10467 const Typed_identifier_list* parameters = fntype->parameters(); 10468 go_assert(parameters != NULL && !parameters->empty()); 10469 Type* varargs_type = parameters->back().type(); 10470 @@ -8624,7 +9209,7 @@ 9158 10471 Bound_method_expression* bme = this->fn_->bound_method_expression(); 9159 10472 if (bme != NULL) … … 9164 10477 9165 10478 // We always pass a pointer when calling a method. 9166 @@ -8665,7 +92 77,7 @@10479 @@ -8665,7 +9250,7 @@ 9167 10480 // old arguments, because we may be traversing them up in some 9168 10481 // caller. FIXME. … … 9173 10486 } 9174 10487 9175 @@ -9117, 11 +9729,21@@10488 @@ -9117,6 +9702,16 @@ 9176 10489 const bool has_closure = func != NULL && func->closure() != NULL; 9177 10490 const bool is_interface_method = interface_method != NULL; 9178 10491 9179 + intclosure_arg;10492 + bool has_closure_arg; 9180 10493 + if (has_closure) 9181 + closure_arg = 1;10494 + has_closure_arg = true; 9182 10495 + else if (func != NULL) 9183 + closure_arg = 0;10496 + has_closure_arg = false; 9184 10497 + else if (is_interface_method) 9185 + closure_arg = 0;10498 + has_closure_arg = false; 9186 10499 + else 9187 + closure_arg = 1;10500 + has_closure_arg = true; 9188 10501 + 9189 10502 int nargs; 9190 10503 tree* args; 9191 10504 if (this->args_ == NULL || this->args_->empty()) 9192 { 9193 - nargs = is_interface_method ? 1 : 0; 9194 + nargs = (is_interface_method ? 1 : 0) + closure_arg; 9195 args = nargs == 0 ? NULL : new tree[nargs]; 9196 } 9197 else if (fntype->parameters() == NULL || fntype->parameters()->empty()) 9198 @@ -9130,7 +9752,7 @@ 9199 go_assert(!is_interface_method 9200 && fntype->is_method() 9201 && this->args_->size() == 1); 9202 - nargs = 1; 9203 + nargs = 1 + closure_arg; 9204 args = new tree[nargs]; 9205 args[0] = this->args_->front()->get_tree(context); 9206 } 9207 @@ -9141,6 +9763,7 @@ 9208 nargs = this->args_->size(); 9209 int i = is_interface_method ? 1 : 0; 9210 nargs += i; 9211 + nargs += closure_arg; 9212 args = new tree[nargs]; 9213 9214 Typed_identifier_list::const_iterator pp = params->begin(); 9215 @@ -9161,36 +9784,71 @@ 10505 @@ -9161,36 +9756,71 @@ 9216 10506 arg_val, 9217 10507 location); … … 9224 10514 } 9225 10515 go_assert(pp == params->end()); 9226 - go_assert(i == nargs); 9227 + go_assert(i + closure_arg == nargs); 10516 go_assert(i == nargs); 9228 10517 } 9229 10518 … … 9251 10540 - if (has_closure) 9252 10541 - fn = func->get_tree_without_closure(gogo); 10542 + tree closure_tree; 9253 10543 + if (func != NULL) 9254 10544 + { 9255 10545 + Named_object* no = func->named_object(); 9256 + go_assert(!no->is_function()9257 + || !no->func_value()->is_descriptor_wrapper());9258 10546 + fn = Func_expression::get_code_pointer(gogo, no, location); 9259 + if (has_closure) 10547 + if (!has_closure) 10548 + closure_tree = NULL_TREE; 10549 + else 9260 10550 + { 9261 + go_assert(closure_arg == 1 && nargs > 0); 9262 + args[nargs - 1] = func->closure()->get_tree(context); 10551 + closure_tree = func->closure()->get_tree(context); 10552 + if (closure_tree == error_mark_node) 10553 + return error_mark_node; 9263 10554 + } 9264 10555 + } … … 9272 10563 - delete[] args; 9273 10564 - return error_mark_node; 9274 + treeclosure_tree = this->fn_->get_tree(context);10565 + closure_tree = this->fn_->get_tree(context); 9275 10566 + if (closure_tree == error_mark_node) 9276 10567 + return error_mark_node; … … 9286 10577 + fnc), 9287 10578 + field, NULL_TREE); 9288 + go_assert(closure_arg == 1 && nargs > 0);9289 + args[nargs - 1] = closure_tree;9290 10579 + } 9291 10580 + else … … 9295 10584 + if (fn == error_mark_node) 9296 10585 + return error_mark_node; 9297 + go_assert(closure_arg == 0);10586 + closure_tree = NULL_TREE; 9298 10587 } 9299 10588 … … 9304 10593 if (TREE_CODE(fndecl) == ADDR_EXPR) 9305 10594 fndecl = TREE_OPERAND(fndecl, 0); 9306 @@ -9198,12 +98 56,7 @@10595 @@ -9198,12 +9828,7 @@ 9307 10596 // Add a type cast in case the type of the function is a recursive 9308 10597 // type which refers to itself. … … 9318 10607 // This is to support builtin math functions when using 80387 math. 9319 10608 tree excess_type = NULL_TREE; 9320 @@ -9247,13 +9900,6 @@ 10609 @@ -9241,19 +9866,38 @@ 10610 if (func == NULL) 10611 fn = save_expr(fn); 10612 10613 + if (!has_closure_arg) 10614 + go_assert(closure_tree == NULL_TREE); 10615 + else 10616 + { 10617 + // Pass the closure argument by calling the function function 10618 + // __go_set_closure. In the order_evaluations pass we have 10619 + // ensured that if any parameters contain call expressions, they 10620 + // will have been moved out to temporary variables. 10621 + 10622 + go_assert(closure_tree != NULL_TREE); 10623 + closure_tree = fold_convert_loc(location.gcc_location(), ptr_type_node, 10624 + closure_tree); 10625 + static tree set_closure_fndecl; 10626 + tree set_closure = Gogo::call_builtin(&set_closure_fndecl, 10627 + location, 10628 + "__go_set_closure", 10629 + 1, 10630 + void_type_node, 10631 + ptr_type_node, 10632 + closure_tree); 10633 + if (set_closure == error_mark_node) 10634 + return error_mark_node; 10635 + fn = build2_loc(location.gcc_location(), COMPOUND_EXPR, 10636 + TREE_TYPE(fn), set_closure, fn); 10637 + } 10638 + 10639 tree ret = build_call_array(excess_type != NULL_TREE ? excess_type : rettype, 10640 fn, nargs, args); 10641 delete[] args; 9321 10642 9322 10643 SET_EXPR_LOCATION(ret, location.gcc_location()); … … 9332 10653 // type F func() F 9333 10654 // we have used ptr_type_node for the return type. Add a cast here 9334 @@ -9274,24 +99 20,6 @@10655 @@ -9274,24 +9918,6 @@ 9335 10656 if (this->results_ != NULL) 9336 10657 ret = this->set_results(context, ret); … … 9357 10678 9358 10679 return ret; 9359 @@ -9774,13 +1040 2,20 @@10680 @@ -9774,13 +10400,20 @@ 9360 10681 void 9361 10682 Array_index_expression::do_check_types(Gogo*) … … 9380 10701 9381 10702 Array_type* array_type = this->array_->type()->array_type(); 9382 @@ -10845,6 +114 80,28 @@10703 @@ -10845,6 +11478,28 @@ 9383 10704 return Expression::traverse(&this->expr_, traverse); 9384 10705 } … … 9409 10730 9410 10731 Type* 9411 @@ -10905,18 +1156 2,188 @@10732 @@ -10905,18 +11560,188 @@ 9412 10733 } 9413 10734 } … … 9466 10787 + 9467 10788 + Struct_field_list* sfl = new Struct_field_list(); 9468 + // The type here is wrong--it should be new_fntype. But we don't9469 + // have new_fntype yet, and itdoesn't really matter.10789 + // The type here is wrong--it should be the C function type. But it 10790 + // doesn't really matter. 9470 10791 + Type* vt = Type::make_pointer_type(Type::make_void_type()); 9471 10792 + sfl->push_back(Struct_field(Typed_identifier("fn.0", vt, loc))); … … 9474 10795 + closure_type = Type::make_pointer_type(closure_type); 9475 10796 + 9476 + Function_type* new_fntype = orig_fntype->copy_with_ closure(closure_type);10797 + Function_type* new_fntype = orig_fntype->copy_with_names(); 9477 10798 + 9478 10799 + Named_object* new_no = gogo->start_function(Gogo::thunk_name(), new_fntype, 9479 10800 + false, loc); 9480 10801 + 10802 + Variable* cvar = new Variable(closure_type, NULL, false, false, false, loc); 10803 + cvar->set_is_used(); 10804 + Named_object* cp = Named_object::make_variable("$closure", NULL, cvar); 10805 + new_no->func_value()->set_closure_var(cp); 10806 + 9481 10807 + gogo->start_block(loc); 9482 +9483 + Named_object* cp = gogo->lookup("closure.0", NULL);9484 + go_assert(cp != NULL9485 + && cp->is_variable()9486 + && cp->var_value()->is_parameter());9487 10808 + 9488 10809 + // Field 0 of the closure is the function code pointer, field 1 is … … 9504 10825 + args = new Expression_list(); 9505 10826 + for (Typed_identifier_list::const_iterator p = new_params->begin(); 9506 + p + 1!= new_params->end();10827 + p != new_params->end(); 9507 10828 + ++p) 9508 10829 + { … … 9607 10928 9608 10929 // Dump ast representation for an interface field reference. 9609 @@ -11114,8 +119 41,10 @@10930 @@ -11114,8 +11939,10 @@ 9610 10931 // as their first argument. If this is for a pointer type, we can 9611 10932 // simply reuse the existing function. We use an internal hack to … … 9620 10941 Named_object* mno = (method->needs_stub_method() 9621 10942 ? method->stub_object() 9622 @@ -11170,22 +1199 9,7 @@10943 @@ -11170,22 +11997,7 @@ 9623 10944 method_type->is_varargs(), 9624 10945 location); … … 9646 10967 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/expressions.h gcc-4.8.1/gcc/go/gofrontend/expressions.h 9647 10968 --- gcc-4.8.1.orig/gcc/go/gofrontend/expressions.h 2013-01-29 00:28:09.000000000 +0000 9648 +++ gcc-4.8.1/gcc/go/gofrontend/expressions.h 2013- 09-13 19:01:43.123198407+000010969 +++ gcc-4.8.1/gcc/go/gofrontend/expressions.h 2013-10-01 16:06:43.988554285 +0000 9649 10970 @@ -16,6 +16,7 @@ 9650 10971 class Traverse; … … 9756 11077 protected: 9757 11078 int 9758 @@ -1532,11 +1556, 68@@11079 @@ -1532,11 +1556,59 @@ 9759 11080 // The function itself. 9760 11081 Named_object* function_; … … 9776 11097 + Func_descriptor_expression(Named_object* fn); 9777 11098 + 9778 + // Set the descriptor wrapper.9779 + void9780 + set_descriptor_wrapper(Named_object* dfn)9781 + {9782 + go_assert(this->dfn_ == NULL);9783 + this->dfn_ = dfn;9784 + }9785 +9786 11099 + // Make the function descriptor type, so that it can be converted. 9787 11100 + static void … … 9800 11113 + 9801 11114 + Expression* 9802 + do_copy(); 11115 + do_copy() 11116 + { return Expression::make_func_descriptor(this->fn_); } 9803 11117 + 9804 11118 + bool … … 9818 11132 + // The function for which this is the descriptor. 9819 11133 + Named_object* fn_; 9820 + // The descriptor function.9821 + Named_object* dfn_;9822 11134 + // The descriptor variable. 9823 11135 + Bvariable* dvar_; … … 9827 11139 9828 11140 class Unknown_expression : public Parser_expression 9829 @@ -1773,10 +18 54,10 @@11141 @@ -1773,10 +1845,10 @@ 9830 11142 class Bound_method_expression : public Expression 9831 11143 { … … 9841 11153 9842 11154 // Return the object which is the first argument. 9843 @@ -1791,20 +18 72,33 @@11155 @@ -1791,20 +1863,33 @@ 9844 11156 first_argument_type() const 9845 11157 { return this->expr_type_; } … … 9878 11190 do_type(); 9879 11191 9880 @@ -1818,7 +19 12,7 @@11192 @@ -1818,7 +1903,7 @@ 9881 11193 do_copy() 9882 11194 { … … 9887 11199 9888 11200 tree 9889 @@ -1828,6 +19 22,11 @@11201 @@ -1828,6 +1913,11 @@ 9890 11202 do_dump_expression(Ast_dump_context*) const; 9891 11203 … … 9899 11211 // as the first argument. 9900 11212 Expression* expr_; 9901 @@ -1835,8 +19 34,12 @@11213 @@ -1835,8 +1925,12 @@ 9902 11214 // NULL in the normal case, non-NULL when using a method from an 9903 11215 // anonymous field which does not require a stub. … … 9914 11226 9915 11227 // A reference to a field in a struct. 9916 @@ -1847,7 +19 50,7 @@11228 @@ -1847,7 +1941,7 @@ 9917 11229 Field_reference_expression(Expression* expr, unsigned int field_index, 9918 11230 Location location) … … 9923 11235 9924 11236 // Return the struct expression. 9925 @@ -1860,6 +19 63,15 @@11237 @@ -1860,6 +1954,15 @@ 9926 11238 field_index() const 9927 11239 { return this->field_index_; } … … 9939 11251 void 9940 11252 set_struct_expression(Expression* expr) 9941 @@ -1914,6 +20 26,9 @@11253 @@ -1914,6 +2017,9 @@ 9942 11254 Expression* expr_; 9943 11255 // The zero-based index of the field we are retrieving. … … 9949 11261 bool called_fieldtrack_; 9950 11262 }; 9951 @@ -1940,6 +20 55,11 @@11263 @@ -1940,6 +2046,11 @@ 9952 11264 name() const 9953 11265 { return this->name_; } … … 9961 11273 // tree for the expression. 9962 11274 tree 9963 @@ -1955,6 +20 75,9 @@11275 @@ -1955,6 +2066,9 @@ 9964 11276 int 9965 11277 do_traverse(Traverse* traverse); … … 9971 11283 do_type(); 9972 11284 9973 @@ -1979,6 +2 102,13 @@11285 @@ -1979,6 +2093,13 @@ 9974 11286 do_dump_expression(Ast_dump_context*) const; 9975 11287 … … 9987 11299 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/go.cc gcc-4.8.1/gcc/go/gofrontend/go.cc 9988 11300 --- gcc-4.8.1.orig/gcc/go/gofrontend/go.cc 2012-10-31 00:38:49.000000000 +0000 9989 +++ gcc-4.8.1/gcc/go/gofrontend/go.cc 2013- 09-13 19:01:43.123198407+000011301 +++ gcc-4.8.1/gcc/go/gofrontend/go.cc 2013-10-01 16:06:43.988554285 +0000 9990 11302 @@ -44,7 +44,7 @@ 9991 11303 GO_EXTERN_C … … 10027 11339 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/gogo-tree.cc gcc-4.8.1/gcc/go/gofrontend/gogo-tree.cc 10028 11340 --- gcc-4.8.1.orig/gcc/go/gofrontend/gogo-tree.cc 2013-01-29 00:28:09.000000000 +0000 10029 +++ gcc-4.8.1/gcc/go/gofrontend/gogo-tree.cc 2013- 09-13 19:01:43.126531731+000011341 +++ gcc-4.8.1/gcc/go/gofrontend/gogo-tree.cc 2013-10-01 16:06:43.988554285 +0000 10030 11342 @@ -755,6 +755,18 @@ 10031 11343 this->build_interface_method_tables(); … … 10072 11384 // have ideal or non-integral type. 10073 11385 if (no->is_const()) 10074 @@ -1255,14 +1278,47 @@ 11386 @@ -986,6 +1009,16 @@ 11387 else 11388 package_name = this->package_->package_name(); 11389 11390 + // Note that this will be misleading if this is an unexported 11391 + // method generated for an embedded imported type. In that case 11392 + // the unexported method should have the package name of the 11393 + // package from which it is imported, but we are going to give 11394 + // it our package name. Fixing this would require knowing the 11395 + // package name, but we only know the package path. It might be 11396 + // better to use package paths here anyhow. This doesn't affect 11397 + // the assembler code, because we always set that name in 11398 + // Function::get_or_make_decl anyhow. FIXME. 11399 + 11400 decl_name = package_name + '.' + Gogo::unpack_hidden_name(this->name_); 11401 11402 Function_type* fntype; 11403 @@ -1028,6 +1061,12 @@ 11404 if (this->tree_ != NULL_TREE) 11405 return this->tree_; 11406 11407 + if (Gogo::is_erroneous_name(this->name_)) 11408 + { 11409 + this->tree_ = error_mark_node; 11410 + return error_mark_node; 11411 + } 11412 + 11413 tree name; 11414 if (this->classification_ == NAMED_OBJECT_TYPE) 11415 name = NULL_TREE; 11416 @@ -1255,14 +1294,23 @@ 10075 11417 if (this->fndecl_ == NULL_TREE) 10076 11418 { … … 10087 11429 + go_assert(FUNCTION_POINTER_TYPE_P(functype)); 10088 11430 + functype = TREE_TYPE(functype); 10089 +10090 + // In the struct, the function type always has a trailing10091 + // closure argument. For the function body, we only use10092 + // that trailing arg if this is a function literal or if it10093 + // is a wrapper created to store in a descriptor. Remove it10094 + // in that case.10095 + if (this->enclosing_ == NULL && !this->is_descriptor_wrapper_)10096 + {10097 + tree old_params = TYPE_ARG_TYPES(functype);10098 + go_assert(old_params != NULL_TREE10099 + && old_params != void_list_node);10100 + tree new_params = NULL_TREE;10101 + tree *pp = &new_params;10102 + while (TREE_CHAIN (old_params) != void_list_node)10103 + {10104 + tree p = TREE_VALUE(old_params);10105 + go_assert(TYPE_P(p));10106 + *pp = tree_cons(NULL_TREE, p, NULL_TREE);10107 + pp = &TREE_CHAIN(*pp);10108 + old_params = TREE_CHAIN (old_params);10109 + }10110 + *pp = void_list_node;10111 + functype = build_function_type(TREE_TYPE(functype), new_params);10112 + }10113 11431 + } 10114 11432 + … … 10124 11442 id, functype); 10125 11443 10126 @@ -1308,9 +1364,6 @@ 11444 @@ -1285,7 +1333,21 @@ 11445 || this->type_->is_method()) 11446 { 11447 TREE_PUBLIC(decl) = 1; 11448 - std::string asm_name = gogo->pkgpath_symbol(); 11449 + std::string pkgpath = gogo->pkgpath_symbol(); 11450 + if (this->type_->is_method() 11451 + && Gogo::is_hidden_name(no->name()) 11452 + && Gogo::hidden_name_pkgpath(no->name()) != gogo->pkgpath()) 11453 + { 11454 + // This is a method we created for an unexported 11455 + // method of an imported embedded type. We need to 11456 + // use the pkgpath of the imported package to avoid 11457 + // a possible name collision. See bug478 for a test 11458 + // case. 11459 + pkgpath = Gogo::hidden_name_pkgpath(no->name()); 11460 + pkgpath = Gogo::pkgpath_for_symbol(pkgpath); 11461 + } 11462 + 11463 + std::string asm_name = pkgpath; 11464 asm_name.append(1, '.'); 11465 asm_name.append(Gogo::unpack_hidden_name(no->name())); 11466 if (this->type_->is_method()) 11467 @@ -1308,9 +1370,6 @@ 10127 11468 DECL_CONTEXT(resdecl) = decl; 10128 11469 DECL_RESULT(decl) = resdecl; … … 10134 11475 // can't inline it, because recover behaves differently in a 10135 11476 // function passed directly to defer. If this is a recover 10136 @@ -1333,29 +13 86,6 @@11477 @@ -1333,29 +1392,6 @@ 10137 11478 resolve_unique_section (decl, 0, 1); 10138 11479 … … 10164 11505 } 10165 11506 return this->fndecl_; 10166 @@ -1382,15 +141 2,44 @@11507 @@ -1382,15 +1418,24 @@ 10167 11508 } 10168 11509 … … 10179 11520 + go_assert(FUNCTION_POINTER_TYPE_P(functype)); 10180 11521 + functype = TREE_TYPE(functype); 10181 +10182 + // In the struct, the function type always has a trailing10183 + // closure argument. Here we are referring to the function10184 + // code directly, and we know it is not a function literal,10185 + // and we know it is not a wrapper created to store in a10186 + // descriptor. Remove that trailing argument.10187 + tree old_params = TYPE_ARG_TYPES(functype);10188 + go_assert(old_params != NULL_TREE && old_params != void_list_node);10189 + tree new_params = NULL_TREE;10190 + tree *pp = &new_params;10191 + while (TREE_CHAIN (old_params) != void_list_node)10192 + {10193 + tree p = TREE_VALUE(old_params);10194 + go_assert(TYPE_P(p));10195 + *pp = tree_cons(NULL_TREE, p, NULL_TREE);10196 + pp = &TREE_CHAIN(*pp);10197 + old_params = TREE_CHAIN (old_params);10198 + }10199 + *pp = void_list_node;10200 + functype = build_function_type(TREE_TYPE(functype), new_params);10201 11522 + } 10202 11523 + … … 10213 11534 functype); 10214 11535 TREE_PUBLIC(decl) = 1; 10215 @@ -1599, 6 +1658,32@@11536 @@ -1599,10 +1644,41 @@ 10216 11537 } 10217 11538 } 10218 11539 } 10219 11540 + 10220 + // The closure variable is passed last, if this is a function 10221 + // literal or a descriptor wrapper. 11541 *pp = NULL_TREE; 11542 11543 DECL_ARGUMENTS(fndecl) = params; 11544 11545 + // If we need a closure variable, fetch it by calling a runtime 11546 + // function. The caller will have called __go_set_closure before 11547 + // the function call. 10222 11548 + if (this->closure_var_ != NULL) 10223 11549 + { … … 10227 11553 + if (var_decl != error_mark_node) 10228 11554 + { 10229 + go_assert(TREE_CODE(var_decl) == PARM_DECL); 10230 + *pp = var_decl; 10231 + pp = &DECL_CHAIN(*pp); 11555 + go_assert(TREE_CODE(var_decl) == VAR_DECL); 11556 + static tree get_closure_fndecl; 11557 + tree get_closure = Gogo::call_builtin(&get_closure_fndecl, 11558 + this->location_, 11559 + "__go_get_closure", 11560 + 0, 11561 + ptr_type_node); 11562 + 11563 + // Mark the __go_get_closure function as pure, since it 11564 + // depends only on the global variable g. 11565 + DECL_PURE_P(get_closure_fndecl) = 1; 11566 + 11567 + get_closure = fold_convert_loc(this->location_.gcc_location(), 11568 + TREE_TYPE(var_decl), get_closure); 11569 + DECL_INITIAL(var_decl) = get_closure; 11570 + DECL_CHAIN(var_decl) = declare_vars; 11571 + declare_vars = var_decl; 10232 11572 + } 10233 11573 + } 10234 + else if (this->enclosing_ != NULL || this->is_descriptor_wrapper_) 10235 + { 10236 + tree parm_decl = build_decl(this->location_.gcc_location(), PARM_DECL, 10237 + get_identifier("$closure"), 10238 + const_ptr_type_node); 10239 + DECL_CONTEXT(parm_decl) = current_function_decl; 10240 + DECL_ARG_TYPE(parm_decl) = const_ptr_type_node; 10241 + *pp = parm_decl; 10242 + pp = &DECL_CHAIN(*pp); 10243 + } 10244 + 10245 *pp = NULL_TREE; 10246 10247 DECL_ARGUMENTS(fndecl) = params; 10248 @@ -1681,6 +1766,13 @@ 11574 + 11575 if (this->block_ != NULL) 11576 { 11577 go_assert(DECL_INITIAL(fndecl) == NULL_TREE); 11578 @@ -1681,6 +1757,13 @@ 10249 11579 10250 11580 DECL_SAVED_TREE(fndecl) = code; … … 10260 11590 10261 11591 // Build the wrappers around function code needed if the function has 10262 @@ -1844,6 +19 36,20 @@11592 @@ -1844,6 +1927,20 @@ 10263 11593 } 10264 11594 } … … 10281 11611 10282 11612 GO_EXTERN_C 10283 @@ -2437,70 +25 43,3 @@11613 @@ -2437,70 +2534,3 @@ 10284 11614 build2(COMPOUND_EXPR, type_tree, call, tmp)); 10285 11615 } … … 10354 11684 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/gogo.cc gcc-4.8.1/gcc/go/gofrontend/gogo.cc 10355 11685 --- gcc-4.8.1.orig/gcc/go/gofrontend/gogo.cc 2013-02-10 06:02:38.000000000 +0000 10356 +++ gcc-4.8.1/gcc/go/gofrontend/gogo.cc 2013- 09-13 19:01:43.126531731+000011686 +++ gcc-4.8.1/gcc/go/gofrontend/gogo.cc 2013-10-01 16:06:43.988554285 +0000 10357 11687 @@ -364,7 +364,7 @@ 10358 11688 // Declare "main" as a function which takes no parameters and … … 10374 11704 else if (!type->is_method()) 10375 11705 { 10376 @@ -1277,6 +1278,14 @@ 11706 @@ -1191,6 +1192,27 @@ 11707 this->interface_types_.push_back(itype); 11708 } 11709 11710 +// Return an erroneous name that indicates that an error has already 11711 +// been reported. 11712 + 11713 +std::string 11714 +Gogo::erroneous_name() 11715 +{ 11716 + static int erroneous_count; 11717 + char name[50]; 11718 + snprintf(name, sizeof name, "$erroneous%d", erroneous_count); 11719 + ++erroneous_count; 11720 + return name; 11721 +} 11722 + 11723 +// Return whether a name is an erroneous name. 11724 + 11725 +bool 11726 +Gogo::is_erroneous_name(const std::string& name) 11727 +{ 11728 + return name.compare(0, 10, "$erroneous") == 0; 11729 +} 11730 + 11731 // Return a name for a thunk object. 11732 11733 std::string 11734 @@ -1277,6 +1299,14 @@ 10377 11735 n.c_str()); 10378 11736 inform(pf->second, "%qs imported here", n.c_str()); … … 10389 11747 } 10390 11748 10391 @@ -1599,8 +16 08,9 @@11749 @@ -1599,8 +1629,9 @@ 10392 11750 return TRAVERSE_CONTINUE; 10393 11751 } … … 10401 11759 int 10402 11760 Lower_parse_tree::function(Named_object* no) 10403 @@ -1732,6 +17 42,146 @@11761 @@ -1732,6 +1763,146 @@ 10404 11762 lower.constant(no, false); 10405 11763 } … … 10433 11791 + && no->func_value()->enclosing() == NULL 10434 11792 + && !no->func_value()->is_method() 10435 + && ! no->func_value()->is_descriptor_wrapper()10436 + && !Gogo::is_ hidden_name(no->name()))11793 + && !Gogo::is_hidden_name(no->name()) 11794 + && !Gogo::is_thunk(no)) 10437 11795 + no->func_value()->descriptor(this->gogo_, no); 10438 11796 + … … 10548 11906 // interfaces. 10549 11907 10550 @@ -2643,6 +2793,13 @@ 11908 @@ -2217,7 +2388,7 @@ 11909 Block* retblock = new Block(enclosing, loc); 11910 retblock->set_end_location(loc); 11911 11912 - Temporary_statement* ts = Statement::make_temporary(Type::lookup_bool_type(), 11913 + Temporary_statement* ts = Statement::make_temporary(shortcut->type(), 11914 left, loc); 11915 retblock->add_statement(ts); 11916 11917 @@ -2391,13 +2562,38 @@ 11918 return TRAVERSE_CONTINUE; 11919 11920 // If there is only one expression with a side-effect, we can 11921 - // usually leave it in place. However, for an assignment statement, 11922 - // we need to evaluate an expression on the right hand side before 11923 - // we evaluate any index expression on the left hand side, so for 11924 - // that case we always move the expression. Otherwise we mishandle 11925 - // m[0] = len(m) where m is a map. 11926 - if (c == 1 && s->classification() != Statement::STATEMENT_ASSIGNMENT) 11927 - return TRAVERSE_CONTINUE; 11928 + // usually leave it in place. 11929 + if (c == 1) 11930 + { 11931 + switch (s->classification()) 11932 + { 11933 + case Statement::STATEMENT_ASSIGNMENT: 11934 + // For an assignment statement, we need to evaluate an 11935 + // expression on the right hand side before we evaluate any 11936 + // index expression on the left hand side, so for that case 11937 + // we always move the expression. Otherwise we mishandle 11938 + // m[0] = len(m) where m is a map. 11939 + break; 11940 + 11941 + case Statement::STATEMENT_EXPRESSION: 11942 + { 11943 + // If this is a call statement that doesn't return any 11944 + // values, it will not have been counted as a value to 11945 + // move. We need to move any subexpressions in case they 11946 + // are themselves call statements that require passing a 11947 + // closure. 11948 + Expression* expr = s->expression_statement()->expr(); 11949 + if (expr->call_expression() != NULL 11950 + && expr->call_expression()->result_count() == 0) 11951 + break; 11952 + return TRAVERSE_CONTINUE; 11953 + } 11954 + 11955 + default: 11956 + // We can leave the expression in place. 11957 + return TRAVERSE_CONTINUE; 11958 + } 11959 + } 11960 11961 bool is_thunk = s->thunk_statement() != NULL; 11962 for (Find_eval_ordering::const_iterator p = find_eval_ordering.begin(); 11963 @@ -2643,10 +2839,17 @@ 10551 11964 Expression* closure = NULL; 10552 11965 if (orig_func->needs_closure()) … … 10562 11975 Variable* orig_closure_var = orig_closure_no->var_value(); 10563 11976 Variable* new_var = new Variable(orig_closure_var->type(), NULL, false, 10564 @@ -2682,22 +2839,7 @@ 11977 - true, false, location); 11978 + false, false, location); 11979 snprintf(buf, sizeof buf, "closure.%u", count); 11980 ++count; 11981 Named_object* new_closure_no = Named_object::make_variable(buf, NULL, 11982 @@ -2682,22 +2885,7 @@ 10565 11983 // Any varargs call has already been lowered. 10566 11984 call->set_varargs_are_lowered(); … … 10586 12004 gogo->add_statement(s); 10587 12005 10588 @@ -2991,7 +31 33,8 @@12006 @@ -2991,7 +3179,8 @@ 10589 12007 return TRAVERSE_CONTINUE; 10590 12008 … … 10596 12014 return TRAVERSE_CONTINUE; 10597 12015 } 10598 @@ -3101,6 +32 44,7 @@12016 @@ -3101,6 +3290,7 @@ 10599 12017 Map_type::make_map_descriptor_type(); 10600 12018 Channel_type::make_chan_type_descriptor_type(); … … 10604 12022 10605 12023 Runtime::convert_types(this); 10606 @@ -3128, 10 +3272,10@@12024 @@ -3128,9 +3318,9 @@ 10607 12025 Location location) 10608 12026 : type_(type), enclosing_(enclosing), results_(NULL), … … 10611 12029 - results_are_named_(false), nointerface_(false), calls_recover_(false), 10612 12030 - is_recover_thunk_(false), has_recover_thunk_(false), 10613 - in_unique_section_(false)10614 12031 + local_type_count_(0), descriptor_(NULL), fndecl_(NULL), defer_stack_(NULL), 10615 12032 + is_sink_(false), results_are_named_(false), nointerface_(false), 10616 12033 + calls_recover_(false), is_recover_thunk_(false), has_recover_thunk_(false), 10617 + in_unique_section_(false), is_descriptor_wrapper_(false)12034 in_unique_section_(false) 10618 12035 { 10619 12036 } 10620 10621 @@ -3206,6 +3350,7 @@ 12037 @@ -3206,15 +3396,16 @@ 10622 12038 { 10623 12039 if (this->closure_var_ == NULL) … … 10627 12043 // we find them. 10628 12044 Location loc = this->type_->location(); 10629 @@ -3229,7 +3374,14 @@ 12045 Struct_field_list* sfl = new Struct_field_list; 12046 Type* struct_type = Type::make_struct_type(sfl, loc); 12047 Variable* var = new Variable(Type::make_pointer_type(struct_type), 12048 - NULL, false, true, false, loc); 12049 + NULL, false, false, false, loc); 12050 var->set_is_used(); 12051 - this->closure_var_ = Named_object::make_variable("closure", NULL, var); 12052 + this->closure_var_ = Named_object::make_variable("$closure", NULL, var); 12053 // Note that the new variable is not in any binding contour. 12054 } 12055 return this->closure_var_; 12056 @@ -3229,7 +3420,14 @@ 10630 12057 return; 10631 12058 Named_object* closure = this->closure_var_; … … 10643 12070 p != this->closure_fields_.end(); 10644 12071 ++p, ++index) 10645 @@ -3410,6 +3 562,102@@12072 @@ -3410,6 +3608,19 @@ 10646 12073 this->block_->determine_types(); 10647 12074 } 10648 12075 10649 +// Build a wrapper function for a function descriptor. A function10650 +// descriptor refers to a function that takes a closure as its last10651 +// argument. In this case there will be no closure, but an indirect10652 +// call will pass nil as the last argument. We need to build a10653 +// wrapper function that accepts and discards that last argument, so10654 +// that cases like -mrtd will work correctly. In most cases the10655 +// wrapper function will simply be a jump.10656 +10657 +Named_object*10658 +Function::make_descriptor_wrapper(Gogo* gogo, Named_object* no,10659 + Function_type* orig_fntype)10660 +{10661 + Location loc = no->location();10662 +10663 + Type* vt = Type::make_pointer_type(Type::make_void_type());10664 + Function_type* new_fntype = orig_fntype->copy_with_closure(vt);10665 +10666 + std::string name = no->name() + "$descriptorfn";10667 + Named_object* dno = gogo->start_function(name, new_fntype, false, loc);10668 + dno->func_value()->is_descriptor_wrapper_ = true;10669 +10670 + // Put the wrapper in a unique section so that it can be discarded10671 + // by the linker if it is not needed. Every top-level function will10672 + // get a wrapper, in case there is a reference other than a call10673 + // from some other package, but most will not need one.10674 + dno->func_value()->set_in_unique_section();10675 +10676 + gogo->start_block(loc);10677 +10678 + Expression* fn = Expression::make_func_reference(no, NULL, loc);10679 +10680 + // Call the function begin wrapped, passing all of the arguments10681 + // except for the last one (the last argument is the ignored10682 + // closure).10683 + const Typed_identifier_list* orig_params = orig_fntype->parameters();10684 + Expression_list* args;10685 + if (orig_params == NULL || orig_params->empty())10686 + args = NULL;10687 + else10688 + {10689 + const Typed_identifier_list* new_params = new_fntype->parameters();10690 + args = new Expression_list();10691 + for (Typed_identifier_list::const_iterator p = new_params->begin();10692 + p + 1 != new_params->end();10693 + ++p)10694 + {10695 + Named_object* p_no = gogo->lookup(p->name(), NULL);10696 + go_assert(p_no != NULL10697 + && p_no->is_variable()10698 + && p_no->var_value()->is_parameter());10699 + args->push_back(Expression::make_var_reference(p_no, loc));10700 + }10701 + }10702 +10703 + Call_expression* call = Expression::make_call(fn, args,10704 + orig_fntype->is_varargs(),10705 + loc);10706 + call->set_varargs_are_lowered();10707 +10708 + Statement* s = Statement::make_return_from_call(call, loc);10709 + gogo->add_statement(s);10710 + Block* b = gogo->finish_block(loc);10711 + gogo->add_block(b, loc);10712 + gogo->lower_block(dno, b);10713 + gogo->finish_function(loc);10714 +10715 + return dno;10716 +}10717 +10718 12076 +// Return the function descriptor, the value you get when you refer to 10719 12077 +// the function in Go code without calling it. 10720 12078 + 10721 12079 +Expression* 10722 +Function::descriptor(Gogo* gogo, Named_object* no)12080 +Function::descriptor(Gogo*, Named_object* no) 10723 12081 +{ 10724 12082 + go_assert(!this->is_method()); 10725 12083 + go_assert(this->closure_var_ == NULL); 10726 + go_assert(!this->is_descriptor_wrapper_);10727 12084 + if (this->descriptor_ == NULL) 10728 + { 10729 + // Make and record the descriptor first, so that when we lower 10730 + // the descriptor wrapper we don't try to make it again. 10731 + Func_descriptor_expression* descriptor = 10732 + Expression::make_func_descriptor(no); 10733 + this->descriptor_ = descriptor; 10734 + if (no->package() == NULL 10735 + && !Linemap::is_predeclared_location(no->location())) 10736 + { 10737 + Named_object* dno = Function::make_descriptor_wrapper(gogo, no, 10738 + this->type_); 10739 + descriptor->set_descriptor_wrapper(dno); 10740 + } 10741 + } 12085 + this->descriptor_ = Expression::make_func_descriptor(no); 10742 12086 + return this->descriptor_; 10743 12087 +} … … 10746 12090 // function, making it if necessary. The value of the variable is set 10747 12091 // by the runtime routines to true if the function is returning, 10748 @@ -3940,6 +41 88,32@@12092 @@ -3940,6 +4151,19 @@ 10749 12093 } 10750 12094 } … … 10755 12099 + 10756 12100 +Expression* 10757 +Function_declaration::descriptor(Gogo* gogo, Named_object* no)12101 +Function_declaration::descriptor(Gogo*, Named_object* no) 10758 12102 +{ 10759 12103 + go_assert(!this->fntype_->is_method()); 10760 12104 + if (this->descriptor_ == NULL) 10761 + { 10762 + // Make and record the descriptor first, so that when we lower 10763 + // the descriptor wrapper we don't try to make it again. 10764 + Func_descriptor_expression* descriptor = 10765 + Expression::make_func_descriptor(no); 10766 + this->descriptor_ = descriptor; 10767 + if (no->package() == NULL 10768 + && !Linemap::is_predeclared_location(no->location())) 10769 + { 10770 + Named_object* dno = Function::make_descriptor_wrapper(gogo, no, 10771 + this->fntype_); 10772 + descriptor->set_descriptor_wrapper(dno); 10773 + } 10774 + } 12105 + this->descriptor_ = Expression::make_func_descriptor(no); 10775 12106 + return this->descriptor_; 10776 12107 +} … … 10779 12110 10780 12111 Variable::Variable(Type* type, Expression* init, bool is_global, 10781 @@ -4755,6 + 5029,12 @@12112 @@ -4755,6 +4979,12 @@ 10782 12113 Named_object::set_function_value(Function* function) 10783 12114 { … … 10794 12125 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/gogo.h gcc-4.8.1/gcc/go/gofrontend/gogo.h 10795 12126 --- gcc-4.8.1.orig/gcc/go/gofrontend/gogo.h 2012-12-21 22:23:23.000000000 +0000 10796 +++ gcc-4.8.1/gcc/go/gofrontend/gogo.h 2013-09-13 19:01:43.126531731 +0000 10797 @@ -476,6 +476,10 @@ 12127 +++ gcc-4.8.1/gcc/go/gofrontend/gogo.h 2013-10-01 16:06:43.988554285 +0000 12128 @@ -387,6 +387,16 @@ 12129 void 12130 mark_locals_used(); 12131 12132 + // Return a name to use for an error case. This should only be used 12133 + // after reporting an error, and is used to avoid useless knockon 12134 + // errors. 12135 + static std::string 12136 + erroneous_name(); 12137 + 12138 + // Return whether the name indicates an error. 12139 + static bool 12140 + is_erroneous_name(const std::string&); 12141 + 12142 // Return a name to use for a thunk function. A thunk function is 12143 // one we create during the compilation, for a go statement or a 12144 // defer statement or a method expression. 12145 @@ -476,6 +486,10 @@ 10798 12146 void 10799 12147 lower_constant(Named_object*); … … 10806 12154 void 10807 12155 finalize_methods(); 10808 @@ -614,10 +6 18,6 @@12156 @@ -614,10 +628,6 @@ 10809 12157 receive_from_channel(tree type_tree, tree type_descriptor_tree, tree channel, 10810 12158 Location); … … 10817 12165 // During parsing, we keep a stack of functions. Each function on 10818 12166 // the stack is one that we are currently parsing. For each 10819 @@ -669,10 +6 69,6 @@12167 @@ -669,10 +679,6 @@ 10820 12168 tree 10821 12169 ptr_go_string_constant_tree(const std::string&); … … 10828 12176 typedef std::map<std::string, Package*> Imports; 10829 12177 10830 @@ -915,6 +9 11,14 @@12178 @@ -915,6 +921,14 @@ 10831 12179 result_variables() 10832 12180 { return this->results_; } … … 10843 12191 bool 10844 12192 results_are_named() const 10845 @@ -1046,6 +1050,12 @@ 10846 set_in_unique_section() 10847 { this->in_unique_section_ = true; } 10848 10849 + // Whether this function was created as a descriptor wrapper for 10850 + // another function. 10851 + bool 10852 + is_descriptor_wrapper() const 10853 + { return this->is_descriptor_wrapper_; } 10854 + 10855 // Swap with another function. Used only for the thunk which calls 10856 // recover. 10857 void 10858 @@ -1059,6 +1069,26 @@ 12193 @@ -1059,6 +1073,22 @@ 10859 12194 void 10860 12195 determine_types(); … … 10876 12211 + } 10877 12212 + 10878 + // Build a descriptor wrapper function.10879 + static Named_object*10880 + make_descriptor_wrapper(Gogo*, Named_object*, Function_type*);10881 +10882 12213 // Return the function's decl given an identifier. 10883 12214 tree 10884 12215 get_or_make_decl(Gogo*, Named_object*, tree id); 10885 @@ -1137,2 5 +1167,32@@12216 @@ -1137,22 +1167,26 @@ 10886 12217 Labels labels_; 10887 12218 // The number of local types defined in this function. … … 10915 12246 // turned on for field tracking. 10916 12247 bool in_unique_section_ : 1; 10917 + // True if this is a function wrapper created to put in a function 10918 + // descriptor. 10919 + bool is_descriptor_wrapper_ : 1; 10920 }; 10921 10922 // A snapshot of the current binding state. 10923 @@ -1198,7 +1235,8 @@ 12248 @@ -1198,7 +1232,8 @@ 10924 12249 { 10925 12250 public: … … 10931 12256 10932 12257 Function_type* 10933 @@ -1218,10 +125 6,27 @@12258 @@ -1218,10 +1253,27 @@ 10934 12259 set_asm_name(const std::string& asm_name) 10935 12260 { this->asm_name_ = asm_name; } … … 10959 12284 void 10960 12285 export_func(Export* exp, const std::string& name) const 10961 @@ -1235,6 +12 90,8 @@12286 @@ -1235,6 +1287,8 @@ 10962 12287 // The assembler name: this is the name to use in references to the 10963 12288 // function. This is normally empty. … … 10968 12293 tree fndecl_; 10969 12294 }; 10970 @@ -1630,7 +168 7,7 @@12295 @@ -1630,7 +1684,7 @@ 10971 12296 Named_constant(Type* type, Expression* expr, int iota_value, 10972 12297 Location location) … … 10977 12302 10978 12303 Type* 10979 @@ -1664,6 +17 21,14 @@12304 @@ -1664,6 +1718,14 @@ 10980 12305 clear_lowering() 10981 12306 { this->lowering_ = false; } … … 10992 12317 int 10993 12318 traverse_expression(Traverse*); 10994 @@ -1699,6 +176 4,8 @@12319 @@ -1699,6 +1761,8 @@ 10995 12320 Location location_; 10996 12321 // Whether we are currently lowering this constant. … … 11003 12328 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/parse.cc gcc-4.8.1/gcc/go/gofrontend/parse.cc 11004 12329 --- gcc-4.8.1.orig/gcc/go/gofrontend/parse.cc 2012-12-13 22:20:23.000000000 +0000 11005 +++ gcc-4.8.1/gcc/go/gofrontend/parse.cc 2013-09-13 19:01:43.129865056 +0000 12330 +++ gcc-4.8.1/gcc/go/gofrontend/parse.cc 2013-10-01 16:06:43.992554285 +0000 12331 @@ -213,7 +213,7 @@ 12332 if (name == "_") 12333 { 12334 error_at(this->location(), "invalid use of %<_%>"); 12335 - name = "blank"; 12336 + name = Gogo::erroneous_name(); 12337 } 12338 12339 if (package->name() == this->gogo_->package_name()) 11006 12340 @@ -1457,6 +1457,16 @@ 11007 12341 … … 11021 12355 if (pe != expr_list->end()) 11022 12356 error_at(this->location(), "too many initializers"); 11023 @@ -2627,7 +2637,11 @@ 12357 @@ -1930,12 +1940,9 @@ 12358 { 12359 if (this->gogo_->in_global_scope()) 12360 return this->create_dummy_global(type, init, location); 12361 - else if (type == NULL) 12362 - this->gogo_->add_statement(Statement::make_statement(init, true)); 12363 else 12364 { 12365 - // With both a type and an initializer, create a dummy 12366 - // variable so that we will check whether the 12367 + // Create a dummy variable so that we will check whether the 12368 // initializer can be assigned to the type. 12369 Variable* var = new Variable(type, init, false, false, false, 12370 location); 12371 @@ -2627,7 +2634,11 @@ 11024 12372 Named_object* this_function = this->gogo_->current_function(); 11025 12373 Named_object* closure = this_function->func_value()->closure_var(); … … 11034 12382 this->enclosing_vars_.insert(ev); 11035 12383 if (ins.second) 11036 @@ -2882,8 +289 6,9 @@12384 @@ -2882,8 +2893,9 @@ 11037 12385 // Create a closure for the nested function FUNCTION. This is based 11038 12386 // on ENCLOSING_VARS, which is a list of all variables defined in … … 11046 12394 Expression* 11047 12395 Parse::create_closure(Named_object* function, Enclosing_vars* enclosing_vars, 11048 @@ -2899,16 +291 4,25 @@12396 @@ -2899,16 +2911,25 @@ 11049 12397 for (Enclosing_vars::const_iterator p = enclosing_vars->begin(); 11050 12398 p != enclosing_vars->end(); … … 11074 12422 Expression* ref; 11075 12423 if (ev[i].in_function() == enclosing_function) 11076 @@ -3016,7 +30 40,7 @@12424 @@ -3016,7 +3037,7 @@ 11077 12425 && t->array_type()->length()->is_nil_expression()) 11078 12426 { … … 11083 12431 } 11084 12432 else 11085 @@ -4499,9 +4523,12 @@ 12433 @@ -3083,7 +3104,7 @@ 12434 if (token->identifier() == "_") 12435 { 12436 error_at(this->location(), "invalid use of %<_%>"); 12437 - name = this->gogo_->pack_hidden_name("blank", false); 12438 + name = Gogo::erroneous_name(); 12439 } 12440 this->advance_token(); 12441 return Expression::make_selector(left, name, location); 12442 @@ -4499,9 +4520,12 @@ 11086 12443 bool is_fallthrough = false; 11087 12444 if (this->peek_token()->is_keyword(KEYWORD_FALLTHROUGH)) … … 11096 12453 11097 12454 if (is_default) 11098 @@ -5239,7 +5266,8 @@ 12455 @@ -4905,7 +4929,7 @@ 12456 { 12457 error_at(recv_var_loc, 12458 "no new variables on left side of %<:=%>"); 12459 - recv_var = "blank"; 12460 + recv_var = Gogo::erroneous_name(); 12461 } 12462 *is_send = false; 12463 *varname = gogo->pack_hidden_name(recv_var, is_rv_exported); 12464 @@ -4941,7 +4965,7 @@ 12465 { 12466 error_at(recv_var_loc, 12467 "no new variables on left side of %<:=%>"); 12468 - recv_var = "blank"; 12469 + recv_var = Gogo::erroneous_name(); 12470 } 12471 *is_send = false; 12472 if (recv_var != "_") 12473 @@ -5239,7 +5263,8 @@ 11099 12474 no->var_value()->set_type_from_range_value(); 11100 12475 if (is_new) … … 11106 12481 11107 12482 if (!any_new) 12483 @@ -5477,7 +5502,7 @@ 12484 if (name == "_") 12485 { 12486 error_at(this->location(), "invalid package name _"); 12487 - name = "blank"; 12488 + name = Gogo::erroneous_name(); 12489 } 12490 this->advance_token(); 12491 } 11108 12492 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/runtime.def gcc-4.8.1/gcc/go/gofrontend/runtime.def 11109 12493 --- gcc-4.8.1.orig/gcc/go/gofrontend/runtime.def 2012-11-29 18:11:17.000000000 +0000 11110 +++ gcc-4.8.1/gcc/go/gofrontend/runtime.def 2013- 09-13 19:01:43.129865056+000012494 +++ gcc-4.8.1/gcc/go/gofrontend/runtime.def 2013-10-01 16:06:43.992554285 +0000 11111 12495 @@ -224,11 +224,6 @@ 11112 12496 DEF_GO_RUNTIME(NEW_NOPOINTERS, "__go_new_nopointers", P1(UINTPTR), R1(POINTER)) … … 11123 12507 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/statements.cc gcc-4.8.1/gcc/go/gofrontend/statements.cc 11124 12508 --- gcc-4.8.1.orig/gcc/go/gofrontend/statements.cc 2012-12-21 15:59:27.000000000 +0000 11125 +++ gcc-4.8.1/gcc/go/gofrontend/statements.cc 2013- 09-13 19:01:43.133198380+000012509 +++ gcc-4.8.1/gcc/go/gofrontend/statements.cc 2013-10-01 16:06:43.992554285 +0000 11126 12510 @@ -569,7 +569,10 @@ 11127 12511 Assignment_statement::do_determine_types() … … 11136 12520 } 11137 12521 11138 @@ -1707,8 +1710,8 @@ 12522 @@ -591,6 +594,15 @@ 12523 12524 Type* lhs_type = this->lhs_->type(); 12525 Type* rhs_type = this->rhs_->type(); 12526 + 12527 + // Invalid assignment of nil to the blank identifier. 12528 + if (lhs_type->is_sink_type() 12529 + && rhs_type->is_nil_type()) 12530 + { 12531 + this->report_error(_("use of untyped nil")); 12532 + return; 12533 + } 12534 + 12535 std::string reason; 12536 bool ok; 12537 if (this->are_hidden_fields_ok_) 12538 @@ -972,7 +984,10 @@ 12539 12540 if ((*plhs)->is_sink_expression()) 12541 { 12542 - b->add_statement(Statement::make_statement(*prhs, true)); 12543 + if ((*prhs)->type()->is_nil_type()) 12544 + this->report_error(_("use of untyped nil")); 12545 + else 12546 + b->add_statement(Statement::make_statement(*prhs, true)); 12547 continue; 12548 } 12549 12550 @@ -1655,46 +1670,23 @@ 12551 location); 12552 } 12553 12554 -// An expression statement. 12555 - 12556 -class Expression_statement : public Statement 12557 -{ 12558 - public: 12559 - Expression_statement(Expression* expr, bool is_ignored) 12560 - : Statement(STATEMENT_EXPRESSION, expr->location()), 12561 - expr_(expr), is_ignored_(is_ignored) 12562 - { } 12563 - 12564 - Expression* 12565 - expr() 12566 - { return this->expr_; } 12567 - 12568 - protected: 12569 - int 12570 - do_traverse(Traverse* traverse) 12571 - { return this->traverse_expression(traverse, &this->expr_); } 12572 - 12573 - void 12574 - do_determine_types() 12575 - { this->expr_->determine_type_no_context(); } 12576 - 12577 - void 12578 - do_check_types(Gogo*); 12579 +// Class Expression_statement. 12580 12581 - bool 12582 - do_may_fall_through() const; 12583 +// Constructor. 12584 12585 - Bstatement* 12586 - do_get_backend(Translate_context* context); 12587 +Expression_statement::Expression_statement(Expression* expr, bool is_ignored) 12588 + : Statement(STATEMENT_EXPRESSION, expr->location()), 12589 + expr_(expr), is_ignored_(is_ignored) 12590 +{ 12591 +} 12592 12593 - void 12594 - do_dump_statement(Ast_dump_context*) const; 12595 +// Determine types. 12596 12597 - private: 12598 - Expression* expr_; 12599 - // Whether the value of this expression is being explicitly ignored. 12600 - bool is_ignored_; 12601 -}; 12602 +void 12603 +Expression_statement::do_determine_types() 12604 +{ 12605 + this->expr_->determine_type_no_context(); 12606 +} 12607 12608 // Check the types of an expression statement. The only check we do 12609 // is to possibly give an error about discarding the value of the 12610 @@ -1707,8 +1699,8 @@ 11139 12611 this->expr_->discarding_value(); 11140 12612 } … … 11147 12619 bool 11148 12620 Expression_statement::do_may_fall_through() const 11149 @@ -1717,22 +17 20,28 @@12621 @@ -1717,22 +1709,28 @@ 11150 12622 if (call != NULL) 11151 12623 { … … 11158 12630 { 11159 12631 - const Named_object* no = fe->named_object(); 11160 + Named_object* no = ue->named_object(); 11161 12632 - 11162 12633 - Function_type* fntype; 11163 12634 - if (no->is_function()) … … 11167 12638 - else 11168 12639 - fntype = NULL; 11169 - 12640 + Named_object* no = ue->named_object(); 12641 11170 12642 - // The builtin function panic does not return. 11171 12643 - if (fntype != NULL && fntype->is_builtin() && no->name() == "panic") … … 11190 12662 } 11191 12663 return true; 11192 @@ -1953,10 +19 62,15 @@12664 @@ -1953,10 +1951,15 @@ 11193 12665 && results->begin()->type()->points_to() == NULL))) 11194 12666 return false; … … 11208 12680 11209 12681 return true; 11210 @@ -2496,7 +2 510,11 @@12682 @@ -2496,7 +2499,11 @@ 11211 12683 11212 12684 Call_expression* ce = this->call_->call_expression(); … … 11221 12693 const Expression_list* args = ce->args(); 11222 12694 if (args == NULL || args->empty()) 11223 @@ -2800,6 +28 18,28 @@12695 @@ -2800,6 +2807,28 @@ 11224 12696 return new Return_statement(vals, location); 11225 12697 } … … 11250 12722 11251 12723 class Bc_statement : public Statement 11252 @@ -3700,9 +37 40,6 @@12724 @@ -3700,9 +3729,6 @@ 11253 12725 void 11254 12726 do_check_types(Gogo*); … … 11260 12732 do_get_backend(Translate_context*); 11261 12733 11262 @@ -3746,22 +37 83,6 @@12734 @@ -3746,22 +3772,6 @@ 11263 12735 this->set_is_error(); 11264 12736 } … … 11283 12755 11284 12756 Bstatement* 11285 @@ -3911,6 +39 32,22 @@12757 @@ -3911,6 +3921,22 @@ 11286 12758 ast_dump_context->ostream() << std::endl; 11287 12759 } … … 11306 12778 11307 12779 Switch_statement* 11308 @@ -4050,6 +40 87,27 @@12780 @@ -4050,6 +4076,27 @@ 11309 12781 } 11310 12782 } … … 11334 12806 11335 12807 void 11336 @@ -4148,6 +4 206,25 @@12808 @@ -4148,6 +4195,25 @@ 11337 12809 NULL); 11338 12810 } … … 11360 12832 11361 12833 void 11362 @@ -4237,6 +43 14,22 @@12834 @@ -4237,6 +4303,22 @@ 11363 12835 return Statement::make_block_statement(b, loc); 11364 12836 } … … 11383 12855 // if necessary. 11384 12856 11385 @@ -4954,6 +50 47,19 @@12857 @@ -4954,6 +5036,19 @@ 11386 12858 return Statement::make_block_statement(b, loc); 11387 12859 } … … 11403 12875 11404 12876 Bstatement* 11405 @@ -5114,6 +52 20,20 @@12877 @@ -5114,6 +5209,20 @@ 11406 12878 this->continue_label_ = continue_label; 11407 12879 } … … 11426 12898 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/statements.h gcc-4.8.1/gcc/go/gofrontend/statements.h 11427 12899 --- gcc-4.8.1.orig/gcc/go/gofrontend/statements.h 2013-01-29 00:28:09.000000000 +0000 11428 +++ gcc-4.8.1/gcc/go/gofrontend/statements.h 2013-09-13 19:01:43.133198380 +0000 11429 @@ -207,6 +207,13 @@ 12900 +++ gcc-4.8.1/gcc/go/gofrontend/statements.h 2013-10-01 16:06:43.992554285 +0000 12901 @@ -17,6 +17,7 @@ 12902 class Unnamed_label; 12903 class Temporary_statement; 12904 class Variable_declaration_statement; 12905 +class Expression_statement; 12906 class Return_statement; 12907 class Thunk_statement; 12908 class Label_statement; 12909 @@ -207,6 +208,13 @@ 11430 12910 static Return_statement* 11431 12911 make_return_statement(Expression_list*, Location); … … 11441 12921 static Statement* 11442 12922 make_break_statement(Unnamed_label* label, Location); 11443 @@ -894,8 +901,7 @@ 12923 @@ -322,6 +330,14 @@ 12924 STATEMENT_VARIABLE_DECLARATION>(); 12925 } 12926 12927 + // If this is an expression statement, return it. Otherwise return 12928 + // NULL. 12929 + Expression_statement* 12930 + expression_statement() 12931 + { 12932 + return this->convert<Expression_statement, STATEMENT_EXPRESSION>(); 12933 + } 12934 + 12935 // If this is a return statement, return it. Otherwise return NULL. 12936 Return_statement* 12937 return_statement() 12938 @@ -629,6 +645,43 @@ 12939 bool is_lowered_; 12940 }; 12941 12942 +// An expression statement. 12943 + 12944 +class Expression_statement : public Statement 12945 +{ 12946 + public: 12947 + Expression_statement(Expression* expr, bool is_ignored); 12948 + 12949 + Expression* 12950 + expr() 12951 + { return this->expr_; } 12952 + 12953 + protected: 12954 + int 12955 + do_traverse(Traverse* traverse) 12956 + { return this->traverse_expression(traverse, &this->expr_); } 12957 + 12958 + void 12959 + do_determine_types(); 12960 + 12961 + void 12962 + do_check_types(Gogo*); 12963 + 12964 + bool 12965 + do_may_fall_through() const; 12966 + 12967 + Bstatement* 12968 + do_get_backend(Translate_context* context); 12969 + 12970 + void 12971 + do_dump_statement(Ast_dump_context*) const; 12972 + 12973 + private: 12974 + Expression* expr_; 12975 + // Whether the value of this expression is being explicitly ignored. 12976 + bool is_ignored_; 12977 +}; 12978 + 12979 // A send statement. 12980 12981 class Send_statement : public Statement 12982 @@ -894,8 +947,7 @@ 11444 12983 { this->clauses_->check_types(); } 11445 12984 … … 11451 12990 Bstatement* 11452 12991 do_get_backend(Translate_context*); 11453 @@ -1086,6 +1 092,9 @@12992 @@ -1086,6 +1138,9 @@ 11454 12993 Statement* 11455 12994 do_lower(Gogo*, Named_object*, Block*, Statement_inserter*); … … 11461 13000 do_get_backend(Translate_context*) 11462 13001 { go_unreachable(); } 11463 @@ -1399,6 +14 08,9 @@13002 @@ -1399,6 +1454,9 @@ 11464 13003 void 11465 13004 do_dump_statement(Ast_dump_context*) const; … … 11471 13010 // The value to switch on. This may be NULL. 11472 13011 Expression* val_; 11473 @@ -1449,6 +1 461,11 @@13012 @@ -1449,6 +1507,11 @@ 11474 13013 lower(Type*, Block*, Temporary_statement* descriptor_temp, 11475 13014 Unnamed_label* break_label) const; … … 11483 13022 void 11484 13023 dump_clauses(Ast_dump_context*) const; 11485 @@ -1493,6 +15 10,12 @@13024 @@ -1493,6 +1556,12 @@ 11486 13025 lower(Type*, Block*, Temporary_statement* descriptor_temp, 11487 13026 Unnamed_label* break_label, Unnamed_label** stmts_label) const; … … 11496 13035 void 11497 13036 dump_clause(Ast_dump_context*) const; 11498 @@ -1556,6 +1 579,9 @@13037 @@ -1556,6 +1625,9 @@ 11499 13038 void 11500 13039 do_dump_statement(Ast_dump_context*) const; … … 11508 13047 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/types.cc gcc-4.8.1/gcc/go/gofrontend/types.cc 11509 13048 --- gcc-4.8.1.orig/gcc/go/gofrontend/types.cc 2013-02-01 00:23:22.000000000 +0000 11510 +++ gcc-4.8.1/gcc/go/gofrontend/types.cc 2013- 09-13 19:01:43.136531705 +000013049 +++ gcc-4.8.1/gcc/go/gofrontend/types.cc 2013-10-01 16:06:43.992554285 +0000 11511 13050 @@ -1298,8 +1298,8 @@ 11512 13051 // converting INITIALIZER. … … 11587 13126 ++p; 11588 13127 go_assert(p == fields->end()); 11589 @@ -3407,6 +3387,19 @@ 13128 @@ -2308,9 +2288,7 @@ 13129 } 13130 13131 case TYPE_NAMED: 13132 - // Begin converting this type to the backend representation. 13133 - // This will create a placeholder if necessary. 13134 - this->get_backend(gogo); 13135 + this->named_type()->convert(gogo); 13136 return this->named_type()->is_named_backend_type_size_known(); 13137 13138 case TYPE_FORWARD: 13139 @@ -3407,6 +3385,16 @@ 11590 13140 Btype* 11591 13141 Function_type::do_get_backend(Gogo* gogo) … … 11594 13144 + // is represented as a pointer to a struct whose first field is the 11595 13145 + // actual function. So that is what we return as the type of a Go 11596 + // function. The function stored in the first field always that 11597 + // takes one additional trailing argument: the closure pointer. For 11598 + // a top-level function, this additional argument will only be 11599 + // passed when invoking the function indirectly, via the struct. 13146 + // function. 11600 13147 + 11601 13148 + Location loc = this->location(); … … 11607 13154 if (this->receiver_ != NULL) 11608 13155 { 11609 @@ -3422,9 +3415,15 @@ 11610 } 11611 11612 std::vector<Backend::Btyped_identifier> bparameters; 11613 - if (this->parameters_ != NULL) 11614 + size_t last; 11615 + if (this->parameters_ == NULL) 11616 + { 11617 + bparameters.resize(1); 11618 + last = 0; 11619 + } 11620 + else 11621 { 11622 - bparameters.resize(this->parameters_->size()); 11623 + bparameters.resize(this->parameters_->size() + 1); 11624 size_t i = 0; 11625 for (Typed_identifier_list::const_iterator p = this->parameters_->begin(); 11626 p != this->parameters_->end(); 11627 @@ -3434,8 +3433,12 @@ 11628 bparameters[i].btype = p->type()->get_backend(gogo); 11629 bparameters[i].location = p->location(); 11630 } 11631 - go_assert(i == bparameters.size()); 11632 + last = i; 11633 } 11634 + go_assert(last + 1 == bparameters.size()); 11635 + bparameters[last].name = "$closure"; 11636 + bparameters[last].btype = ptr_struct_type; 11637 + bparameters[last].location = loc; 11638 11639 std::vector<Backend::Btyped_identifier> bresults; 11640 if (this->results_ != NULL) 11641 @@ -3453,8 +3456,15 @@ 13156 @@ -3453,8 +3441,15 @@ 11642 13157 go_assert(i == bresults.size()); 11643 13158 } … … 11657 13172 11658 13173 // The type of a function type descriptor. 11659 @@ -3826,6 +38 36,49@@13174 @@ -3826,6 +3821,47 @@ 11660 13175 return ret; 11661 13176 } … … 11665 13180 + 11666 13181 +Function_type* 11667 +Function_type::copy_with_ closure(Type* closure_type) const13182 +Function_type::copy_with_names() const 11668 13183 +{ 11669 13184 + Typed_identifier_list* new_params = new Typed_identifier_list(); … … 11683 13198 + } 11684 13199 + } 11685 + new_params->push_back(Typed_identifier("closure.0", closure_type,11686 + this->location_));11687 13200 + 11688 13201 + const Typed_identifier_list* orig_results = this->results_; … … 11707 13220 11708 13221 Function_type* 11709 @@ -4168,6 +42 21,22 @@13222 @@ -4168,6 +4204,22 @@ 11710 13223 } 11711 13224 } … … 11730 13243 11731 13244 // A hash table used to find identical unnamed structs so that they 11732 @@ -4532,6 +4601,7 @@ 13245 @@ -4175,6 +4227,11 @@ 13246 13247 Struct_type::Identical_structs Struct_type::identical_structs; 13248 13249 +// A hash table used to merge method sets for identical unnamed 13250 +// structs. 13251 + 13252 +Struct_type::Struct_method_tables Struct_type::struct_method_tables; 13253 + 13254 // Traversal. 13255 13256 int 13257 @@ -4532,6 +4589,7 @@ 11733 13258 go_assert(sub != NULL); 11734 13259 } … … 11738 13263 else if (subdepth > found_depth) 11739 13264 delete sub; 11740 @@ -4781,11 +4851,16 @@ 13265 @@ -4638,9 +4696,24 @@ 13266 const Interface_type* interface, 13267 bool is_pointer) 13268 { 13269 + std::pair<Struct_type*, Struct_type::Struct_method_table_pair*> 13270 + val(this, NULL); 13271 + std::pair<Struct_type::Struct_method_tables::iterator, bool> ins = 13272 + Struct_type::struct_method_tables.insert(val); 13273 + 13274 + Struct_method_table_pair* smtp; 13275 + if (!ins.second) 13276 + smtp = ins.first->second; 13277 + else 13278 + { 13279 + smtp = new Struct_method_table_pair(); 13280 + smtp->first = NULL; 13281 + smtp->second = NULL; 13282 + ins.first->second = smtp; 13283 + } 13284 + 13285 return Type::interface_method_table(gogo, this, interface, is_pointer, 13286 - &this->interface_method_tables_, 13287 - &this->pointer_interface_method_tables_); 13288 + &smtp->first, &smtp->second); 13289 } 13290 13291 // Convert struct fields to the backend representation. This is not 13292 @@ -4781,11 +4854,16 @@ 11741 13293 11742 13294 ++q; … … 11758 13310 fvals->push_back(Expression::make_unary(OPERATOR_AND, s, bloc)); 11759 13311 } 11760 @@ -6227,7 +630 2,8 @@13312 @@ -6227,7 +6305,8 @@ 11761 13313 11762 13314 std::string mangled_name = "__go_map_" + this->mangled_name(gogo); … … 11768 13320 bloc); 11769 13321 11770 @@ -6235,7 +631 1,7 @@13322 @@ -6235,7 +6314,7 @@ 11771 13323 context.set_is_const(); 11772 13324 Bexpression* binitializer = tree_to_expr(initializer->get_tree(&context)); … … 11777 13329 binitializer); 11778 13330 11779 @@ -7569,7 +764 5,7 @@13331 @@ -7569,7 +7648,7 @@ 11780 13332 // the child class. 11781 13333 return this->do_bind_method(expr, location); … … 11786 13338 11787 13339 // Return the named object associated with a method. This may only be 11788 @@ -7612,8 +76 88,8 @@13340 @@ -7612,8 +7691,8 @@ 11789 13341 Named_method::do_bind_method(Expression* expr, Location location) const 11790 13342 { … … 11797 13349 // the real method expects a different type. We need to cast the 11798 13350 // first argument. 11799 @@ -8991,28 +90 67,16 @@13351 @@ -8991,28 +9070,16 @@ 11800 13352 Call_expression* call = Expression::make_call(func, arguments, is_varargs, 11801 13353 location); … … 11831 13383 11832 13384 // Apply FIELD_INDEXES to EXPR. The field indexes have to be applied 11833 @@ -9353,13 +9417,18 @@ 13385 @@ -9202,7 +9269,11 @@ 13386 } 13387 else 13388 { 13389 - if (!ambig1.empty()) 13390 + if (Gogo::is_erroneous_name(name)) 13391 + { 13392 + // An error was already reported. 13393 + } 13394 + else if (!ambig1.empty()) 13395 error_at(location, "%qs is ambiguous via %qs and %qs", 13396 Gogo::message_name(name).c_str(), ambig1.c_str(), 13397 ambig2.c_str()); 13398 @@ -9353,13 +9424,18 @@ 11834 13399 fnt = pf->type()->deref()->named_type(); 11835 13400 go_assert(fnt != NULL); … … 11853 13418 diff -Naur gcc-4.8.1.orig/gcc/go/gofrontend/types.h gcc-4.8.1/gcc/go/gofrontend/types.h 11854 13419 --- gcc-4.8.1.orig/gcc/go/gofrontend/types.h 2013-02-01 00:23:22.000000000 +0000 11855 +++ gcc-4.8.1/gcc/go/gofrontend/types.h 2013- 09-13 19:01:43.139865030+000013420 +++ gcc-4.8.1/gcc/go/gofrontend/types.h 2013-10-01 16:06:43.992554285 +0000 11856 13421 @@ -523,6 +523,14 @@ 11857 13422 static Type* … … 11888 13453 copy_with_receiver(Type*) const; 11889 13454 11890 + // Return a copy of this type ignoring any receiver and adding a11891 + // final closure parameter of type CLOSURE_TYPE. This is used when11892 + // creating descriptors.13455 + // Return a copy of this type ignoring any receiver and using dummy 13456 + // names for all parameters. This is used for thunks for method 13457 + // values. 11893 13458 + Function_type* 11894 + copy_with_ closure(Type* closure_type) const;13459 + copy_with_names() const; 11895 13460 + 11896 13461 static Type* … … 11917 13482 Type* 11918 13483 type() const 13484 @@ -2031,8 +2041,7 @@ 13485 public: 13486 Struct_type(Struct_field_list* fields, Location location) 13487 : Type(TYPE_STRUCT), 13488 - fields_(fields), location_(location), all_methods_(NULL), 13489 - interface_method_tables_(NULL), pointer_interface_method_tables_(NULL) 13490 + fields_(fields), location_(location), all_methods_(NULL) 13491 { } 13492 13493 // Return the field NAME. This only looks at local fields, not at 13494 @@ -2190,6 +2199,16 @@ 13495 13496 static Identical_structs identical_structs; 13497 13498 + // Used to manage method tables for identical unnamed structs. 13499 + typedef std::pair<Interface_method_tables*, Interface_method_tables*> 13500 + Struct_method_table_pair; 13501 + 13502 + typedef Unordered_map_hash(Struct_type*, Struct_method_table_pair*, 13503 + Type_hash_identical, Type_identical) 13504 + Struct_method_tables; 13505 + 13506 + static Struct_method_tables struct_method_tables; 13507 + 13508 // Used to avoid infinite loops in field_reference_depth. 13509 struct Saw_named_type 13510 { 13511 @@ -2208,13 +2227,6 @@ 13512 Location location_; 13513 // If this struct is unnamed, a list of methods. 13514 Methods* all_methods_; 13515 - // A mapping from interfaces to the associated interface method 13516 - // tables for this type. Only used if this struct is unnamed. 13517 - Interface_method_tables* interface_method_tables_; 13518 - // A mapping from interfaces to the associated interface method 13519 - // tables for pointers to this type. Only used if this struct is 13520 - // unnamed. 13521 - Interface_method_tables* pointer_interface_method_tables_; 13522 }; 13523 13524 // The type of an array. 11919 13525 diff -Naur gcc-4.8.1.orig/gcc/graphite-clast-to-gimple.c gcc-4.8.1/gcc/graphite-clast-to-gimple.c 11920 13526 --- gcc-4.8.1.orig/gcc/graphite-clast-to-gimple.c 2013-01-10 20:38:27.000000000 +0000 11921 +++ gcc-4.8.1/gcc/graphite-clast-to-gimple.c 2013- 09-13 19:01:43.959862879 +000013527 +++ gcc-4.8.1/gcc/graphite-clast-to-gimple.c 2013-10-01 16:07:00.564553809 +0000 11922 13528 @@ -1170,8 +1170,11 @@ 11923 13529 redirect_edge_succ_nodup (next_e, after); … … 11935 13541 diff -Naur gcc-4.8.1.orig/gcc/graphite-dependences.c gcc-4.8.1/gcc/graphite-dependences.c 11936 13542 --- gcc-4.8.1.orig/gcc/graphite-dependences.c 2013-01-10 20:38:27.000000000 +0000 11937 +++ gcc-4.8.1/gcc/graphite-dependences.c 2013- 09-13 19:01:43.963196204+000013543 +++ gcc-4.8.1/gcc/graphite-dependences.c 2013-10-01 16:07:00.564553809 +0000 11938 13544 @@ -297,7 +297,7 @@ 11939 13545 int depth) … … 11964 13570 diff -Naur gcc-4.8.1.orig/gcc/ipa-cp.c gcc-4.8.1/gcc/ipa-cp.c 11965 13571 --- gcc-4.8.1.orig/gcc/ipa-cp.c 2013-05-09 11:56:32.000000000 +0000 11966 +++ gcc-4.8.1/gcc/ipa-cp.c 2013- 09-13 19:01:43.166531626+000013572 +++ gcc-4.8.1/gcc/ipa-cp.c 2013-10-01 16:06:43.996554285 +0000 11967 13573 @@ -1507,7 +1507,8 @@ 11968 13574 tree otr_type; … … 11987 13593 diff -Naur gcc-4.8.1.orig/gcc/ipa-prop.c gcc-4.8.1/gcc/ipa-prop.c 11988 13594 --- gcc-4.8.1.orig/gcc/ipa-prop.c 2013-05-23 13:25:23.000000000 +0000 11989 +++ gcc-4.8.1/gcc/ipa-prop.c 2013- 09-13 19:01:43.169864951+000013595 +++ gcc-4.8.1/gcc/ipa-prop.c 2013-10-01 16:06:43.996554285 +0000 11990 13596 @@ -678,13 +678,19 @@ 11991 13597 bool modified = false; … … 12014 13620 diff -Naur gcc-4.8.1.orig/gcc/ira.c gcc-4.8.1/gcc/ira.c 12015 13621 --- gcc-4.8.1.orig/gcc/ira.c 2013-05-23 10:36:55.000000000 +0000 12016 +++ gcc-4.8.1/gcc/ira.c 2013- 09-13 19:01:43.169864951+000013622 +++ gcc-4.8.1/gcc/ira.c 2013-10-01 16:06:43.996554285 +0000 12017 13623 @@ -2863,6 +2863,28 @@ 12018 13624 } … … 12112 13718 diff -Naur gcc-4.8.1.orig/gcc/lra-assigns.c gcc-4.8.1/gcc/lra-assigns.c 12113 13719 --- gcc-4.8.1.orig/gcc/lra-assigns.c 2013-02-15 19:17:02.000000000 +0000 12114 +++ gcc-4.8.1/gcc/lra-assigns.c 2013- 09-13 19:01:43.173198275 +000013720 +++ gcc-4.8.1/gcc/lra-assigns.c 2013-10-01 16:06:43.996554285 +0000 12115 13721 @@ -116,6 +116,11 @@ 12116 13722 /* Map regno to the corresponding regno assignment info. */ … … 12160 13766 diff -Naur gcc-4.8.1.orig/gcc/lra-constraints.c gcc-4.8.1/gcc/lra-constraints.c 12161 13767 --- gcc-4.8.1.orig/gcc/lra-constraints.c 2013-05-02 19:16:29.000000000 +0000 12162 +++ gcc-4.8.1/gcc/lra-constraints.c 2013- 09-13 19:01:43.173198275 +000013768 +++ gcc-4.8.1/gcc/lra-constraints.c 2013-10-01 16:06:43.996554285 +0000 12163 13769 @@ -1388,7 +1388,7 @@ 12164 13770 for (nalt = 0; nalt < n_alternatives; nalt++) … … 12181 13787 diff -Naur gcc-4.8.1.orig/gcc/omp-low.c gcc-4.8.1/gcc/omp-low.c 12182 13788 --- gcc-4.8.1.orig/gcc/omp-low.c 2013-05-16 10:45:55.000000000 +0000 12183 +++ gcc-4.8.1/gcc/omp-low.c 2013- 09-13 19:01:43.179864925 +000013789 +++ gcc-4.8.1/gcc/omp-low.c 2013-10-01 16:06:44.000554285 +0000 12184 13790 @@ -836,6 +836,7 @@ 12185 13791 DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var); … … 12190 13796 DECL_SEEN_IN_BIND_EXPR_P (copy) = 1; 12191 13797 13798 @@ -5009,8 +5010,7 @@ 13799 { 13800 /* If we are not inside a combined parallel+sections region, 13801 call GOMP_sections_start. */ 13802 - t = build_int_cst (unsigned_type_node, 13803 - exit_reachable ? len - 1 : len); 13804 + t = build_int_cst (unsigned_type_node, len - 1); 13805 u = builtin_decl_explicit (BUILT_IN_GOMP_SECTIONS_START); 13806 stmt = gimple_build_call (u, 1, t); 13807 } 12192 13808 diff -Naur gcc-4.8.1.orig/gcc/passes.c gcc-4.8.1/gcc/passes.c 12193 13809 --- gcc-4.8.1.orig/gcc/passes.c 2013-02-20 15:19:13.000000000 +0000 12194 +++ gcc-4.8.1/gcc/passes.c 2013- 09-13 19:01:43.179864925 +000012195 @@ -1531,1 5 +1531,15@@13810 +++ gcc-4.8.1/gcc/passes.c 2013-10-01 16:06:44.000554285 +0000 13811 @@ -1531,18 +1531,21 @@ 12196 13812 /* Perform simple scalar cleanup which is constant/copy propagation. */ 12197 13813 NEXT_PASS (pass_ccp); … … 12213 13829 need to adjust LIM to be more friendly towards preserving accurate 12214 13830 debug information here. */ 13831 + /* Split critical edges before late uninit warning to reduce the 13832 + number of false positives from it. */ 13833 + NEXT_PASS (pass_split_crit_edges); 13834 NEXT_PASS (pass_late_warn_uninitialized); 13835 NEXT_PASS (pass_uncprop); 13836 NEXT_PASS (pass_local_pure_const); 12215 13837 diff -Naur gcc-4.8.1.orig/gcc/recog.c gcc-4.8.1/gcc/recog.c 12216 13838 --- gcc-4.8.1.orig/gcc/recog.c 2013-01-10 20:38:27.000000000 +0000 12217 +++ gcc-4.8.1/gcc/recog.c 2013- 09-13 19:01:43.183198249+000013839 +++ gcc-4.8.1/gcc/recog.c 2013-10-01 16:06:44.000554285 +0000 12218 13840 @@ -1949,9 +1949,6 @@ 12219 13841 (strictp ? strict_memory_address_addr_space_p … … 12357 13979 { 12358 13980 add_to_hard_reg_set (reg_set, mode, regno); 13981 diff -Naur gcc-4.8.1.orig/gcc/recog.h gcc-4.8.1/gcc/recog.h 13982 --- gcc-4.8.1.orig/gcc/recog.h 2013-01-10 20:38:27.000000000 +0000 13983 +++ gcc-4.8.1/gcc/recog.h 2013-10-01 16:06:44.000554285 +0000 13984 @@ -256,7 +256,57 @@ 13985 13986 typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode); 13987 typedef const char * (*insn_output_fn) (rtx *, rtx); 13988 -typedef rtx (*insn_gen_fn) (rtx, ...); 13989 + 13990 +struct insn_gen_fn 13991 +{ 13992 + typedef rtx (*f0) (void); 13993 + typedef rtx (*f1) (rtx); 13994 + typedef rtx (*f2) (rtx, rtx); 13995 + typedef rtx (*f3) (rtx, rtx, rtx); 13996 + typedef rtx (*f4) (rtx, rtx, rtx, rtx); 13997 + typedef rtx (*f5) (rtx, rtx, rtx, rtx, rtx); 13998 + typedef rtx (*f6) (rtx, rtx, rtx, rtx, rtx, rtx); 13999 + typedef rtx (*f7) (rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14000 + typedef rtx (*f8) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14001 + typedef rtx (*f9) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14002 + typedef rtx (*f10) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14003 + typedef rtx (*f11) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14004 + typedef rtx (*f12) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14005 + typedef rtx (*f13) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14006 + typedef rtx (*f14) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14007 + typedef rtx (*f15) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14008 + typedef rtx (*f16) (rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx); 14009 + 14010 + typedef f0 stored_funcptr; 14011 + 14012 + rtx operator () (void) const { return ((f0)func) (); } 14013 + rtx operator () (rtx a0) const { return ((f1)func) (a0); } 14014 + rtx operator () (rtx a0, rtx a1) const { return ((f2)func) (a0, a1); } 14015 + rtx operator () (rtx a0, rtx a1, rtx a2) const { return ((f3)func) (a0, a1, a2); } 14016 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3) const { return ((f4)func) (a0, a1, a2, a3); } 14017 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4) const { return ((f5)func) (a0, a1, a2, a3, a4); } 14018 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5) const { return ((f6)func) (a0, a1, a2, a3, a4, a5); } 14019 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6) const { return ((f7)func) (a0, a1, a2, a3, a4, a5, a6); } 14020 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7) const { return ((f8)func) (a0, a1, a2, a3, a4, a5, a6, a7); } 14021 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8) const { return ((f9)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8); } 14022 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9) const { return ((f10)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } 14023 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10) const { return ((f11)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } 14024 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11) const { return ((f12)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } 14025 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12) const { return ((f13)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } 14026 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13) const { return ((f14)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } 14027 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14) const { return ((f15)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } 14028 + rtx operator () (rtx a0, rtx a1, rtx a2, rtx a3, rtx a4, rtx a5, rtx a6, rtx a7, rtx a8, rtx a9, rtx a10, rtx a11, rtx a12, rtx a13, rtx a14, rtx a15) const { return ((f16)func) (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } 14029 + 14030 + // This is for compatibility of code that invokes functions like 14031 + // (*funcptr) (arg) 14032 + insn_gen_fn operator * (void) const { return *this; } 14033 + 14034 + // The wrapped function pointer must be public and there must not be any 14035 + // constructors. Otherwise the insn_data_d struct initializers generated 14036 + // by genoutput.c will result in static initializer functions, which defeats 14037 + // the purpose of the generated insn_data_d array. 14038 + stored_funcptr func; 14039 +}; 14040 14041 struct insn_operand_data 14042 { 12359 14043 diff -Naur gcc-4.8.1.orig/gcc/simplify-rtx.c gcc-4.8.1/gcc/simplify-rtx.c 12360 14044 --- gcc-4.8.1.orig/gcc/simplify-rtx.c 2013-03-05 06:04:14.000000000 +0000 12361 +++ gcc-4.8.1/gcc/simplify-rtx.c 2013- 09-13 19:01:43.183198249+000014045 +++ gcc-4.8.1/gcc/simplify-rtx.c 2013-10-01 16:06:44.000554285 +0000 12362 14046 @@ -2784,6 +2784,7 @@ 12363 14047 HOST_WIDE_INT mask = INTVAL (trueop1) << count; … … 12370 14054 diff -Naur gcc-4.8.1.orig/gcc/testsuite/c-c++-common/gomp/pr58257.c gcc-4.8.1/gcc/testsuite/c-c++-common/gomp/pr58257.c 12371 14055 --- gcc-4.8.1.orig/gcc/testsuite/c-c++-common/gomp/pr58257.c 1970-01-01 00:00:00.000000000 +0000 12372 +++ gcc-4.8.1/gcc/testsuite/c-c++-common/gomp/pr58257.c 2013- 09-13 19:01:43.186531574+000014056 +++ gcc-4.8.1/gcc/testsuite/c-c++-common/gomp/pr58257.c 2013-10-01 16:06:44.000554285 +0000 12373 14057 @@ -0,0 +1,15 @@ 12374 14058 +/* PR middle-end/58257 */ … … 12389 14073 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C 12390 14074 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C 1970-01-01 00:00:00.000000000 +0000 12391 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C 2013- 09-13 19:01:43.196531548+000014075 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/constexpr-value4.C 2013-10-01 16:06:44.008554285 +0000 12392 14076 @@ -0,0 +1,16 @@ 12393 14077 +// PR c++/57901 … … 12409 14093 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/decltype55.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/decltype55.C 12410 14094 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/decltype55.C 1970-01-01 00:00:00.000000000 +0000 12411 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/decltype55.C 2013- 09-13 19:01:43.196531548+000014095 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/decltype55.C 2013-10-01 16:06:44.008554285 +0000 12412 14096 @@ -0,0 +1,20 @@ 12413 14097 +// PR c++/53211 … … 12433 14117 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/defaulted44.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted44.C 12434 14118 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/defaulted44.C 1970-01-01 00:00:00.000000000 +0000 12435 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted44.C 2013- 09-13 19:01:43.196531548+000014119 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted44.C 2013-10-01 16:06:44.008554285 +0000 12436 14120 @@ -0,0 +1,24 @@ 12437 14121 +// PR c++/57319 … … 12461 14145 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/defaulted45.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted45.C 12462 14146 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/defaulted45.C 1970-01-01 00:00:00.000000000 +0000 12463 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted45.C 2013- 09-13 19:01:43.196531548+000014147 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/defaulted45.C 2013-10-01 16:06:44.008554285 +0000 12464 14148 @@ -0,0 +1,20 @@ 12465 14149 +// { dg-do run } … … 12485 14169 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/initlist71.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/initlist71.C 12486 14170 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/initlist71.C 1970-01-01 00:00:00.000000000 +0000 12487 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/initlist71.C 2013- 09-13 19:01:43.196531548+000014171 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/initlist71.C 2013-10-01 16:06:44.008554285 +0000 12488 14172 @@ -0,0 +1,9 @@ 12489 14173 +// PR c++/56930 … … 12498 14182 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto3.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto3.C 12499 14183 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto3.C 1970-01-01 00:00:00.000000000 +0000 12500 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto3.C 2013- 09-13 19:01:43.196531548+000014184 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-auto3.C 2013-10-01 16:06:44.008554285 +0000 12501 14185 @@ -0,0 +1,24 @@ 12502 14186 +// PR c++/57526 … … 12526 14210 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C 12527 14211 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C 1970-01-01 00:00:00.000000000 +0000 12528 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C 2013- 09-13 19:01:43.196531548+000014212 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-defarg5.C 2013-10-01 16:06:44.008554285 +0000 12529 14213 @@ -0,0 +1,30 @@ 12530 14214 +// PR c++/58083 … … 12560 14244 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-return1.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-return1.C 12561 14245 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-return1.C 1970-01-01 00:00:00.000000000 +0000 12562 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-return1.C 2013- 09-13 19:01:43.196531548+000014246 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-return1.C 2013-10-01 16:06:44.008554285 +0000 12563 14247 @@ -0,0 +1,26 @@ 12564 14248 +// PR c++/57437 … … 12590 14274 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/noexcept21.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/noexcept21.C 12591 14275 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/noexcept21.C 1970-01-01 00:00:00.000000000 +0000 12592 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/noexcept21.C 2013- 09-13 19:01:43.196531548+000014276 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/noexcept21.C 2013-10-01 16:06:44.012554285 +0000 12593 14277 @@ -0,0 +1,87 @@ 12594 14278 +// PR c++/57645 … … 12681 14365 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/pr57981.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/pr57981.C 12682 14366 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/pr57981.C 1970-01-01 00:00:00.000000000 +0000 12683 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/pr57981.C 2013- 09-13 19:01:43.196531548+000014367 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/pr57981.C 2013-10-01 16:06:44.012554285 +0000 12684 14368 @@ -0,0 +1,17 @@ 12685 14369 +// { dg-options "-std=c++11 -Wall -Wextra" } … … 12702 14386 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C 12703 14387 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C 1970-01-01 00:00:00.000000000 +0000 12704 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C 2013- 09-13 19:01:43.199864872+000014388 +++ gcc-4.8.1/gcc/testsuite/g++.dg/cpp0x/ref-qual14.C 2013-10-01 16:06:44.012554285 +0000 12705 14389 @@ -0,0 +1,18 @@ 12706 14390 +// PR c++/57825 … … 12724 14408 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/debug/template2.C gcc-4.8.1/gcc/testsuite/g++.dg/debug/template2.C 12725 14409 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/debug/template2.C 1970-01-01 00:00:00.000000000 +0000 12726 +++ gcc-4.8.1/gcc/testsuite/g++.dg/debug/template2.C 2013- 09-13 19:01:43.199864872+000014410 +++ gcc-4.8.1/gcc/testsuite/g++.dg/debug/template2.C 2013-10-01 16:06:44.012554285 +0000 12727 14411 @@ -0,0 +1,14 @@ 12728 14412 +// PR c++/57545 … … 12742 14426 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/expr/const1.C gcc-4.8.1/gcc/testsuite/g++.dg/expr/const1.C 12743 14427 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/expr/const1.C 1970-01-01 00:00:00.000000000 +0000 12744 +++ gcc-4.8.1/gcc/testsuite/g++.dg/expr/const1.C 2013- 09-13 19:01:43.199864872+000014428 +++ gcc-4.8.1/gcc/testsuite/g++.dg/expr/const1.C 2013-10-01 16:06:44.012554285 +0000 12745 14429 @@ -0,0 +1,9 @@ 12746 14430 +// PR c++/57551 … … 12755 14439 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/ext/pr57362.C gcc-4.8.1/gcc/testsuite/g++.dg/ext/pr57362.C 12756 14440 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/ext/pr57362.C 1970-01-01 00:00:00.000000000 +0000 12757 +++ gcc-4.8.1/gcc/testsuite/g++.dg/ext/pr57362.C 2013- 09-13 19:01:43.199864872+000014441 +++ gcc-4.8.1/gcc/testsuite/g++.dg/ext/pr57362.C 2013-10-01 16:06:44.012554285 +0000 12758 14442 @@ -0,0 +1,199 @@ 12759 14443 +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ … … 12956 14640 +/* { dg-prune-output "int foo.* previously defined here" } */ 12957 14641 +/* { dg-prune-output "No dispatcher found for" } */ 14642 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/ext/pr57735.C gcc-4.8.1/gcc/testsuite/g++.dg/ext/pr57735.C 14643 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/ext/pr57735.C 1970-01-01 00:00:00.000000000 +0000 14644 +++ gcc-4.8.1/gcc/testsuite/g++.dg/ext/pr57735.C 2013-10-01 16:06:44.012554285 +0000 14645 @@ -0,0 +1,145 @@ 14646 +/* { dg-do compile { target arm*-*-* } } */ 14647 +/* { dg-options "-march=armv5te -marm -mtune=xscale -mfloat-abi=soft -O1" } */ 14648 + 14649 +typedef unsigned int size_t; 14650 +__extension__ 14651 +typedef long long int int64_t; 14652 +namespace WTF { 14653 + template<typename T> class RefPtr { 14654 + public: 14655 + inline T* operator->() const { return m_ptr; } 14656 + T* m_ptr; 14657 + }; 14658 +} 14659 +using WTF::RefPtr; 14660 +namespace JSC { 14661 + class ExecState; 14662 + class JSString; 14663 + typedef int64_t EncodedJSValue; 14664 + class JSValue { 14665 + public: 14666 + static EncodedJSValue encode(JSValue); 14667 + JSString* toString(ExecState*) const; 14668 + }; 14669 +} 14670 +typedef unsigned char LChar; 14671 + typedef short unsigned int UChar; 14672 +namespace WTF { 14673 + template<typename T, size_t inlineCapacity = 0> 14674 + class Vector { 14675 + public: 14676 + template<typename U> bool tryAppend(const U*, size_t); 14677 + }; 14678 +} 14679 +using WTF::Vector; 14680 +namespace WTF { 14681 +template<typename CharType> inline bool isASCIIDigit(CharType c) 14682 +{ 14683 +} 14684 +template<typename CharType> inline bool isASCIIHexDigit(CharType c) 14685 +{ 14686 + return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); 14687 +} 14688 + class StringImpl; 14689 +} 14690 +using WTF::StringImpl; 14691 +namespace WTF { 14692 +class StringImpl { 14693 +public: 14694 + unsigned length() const { return m_length; } 14695 + unsigned m_length; 14696 +}; 14697 +} 14698 +namespace JSC { 14699 + class Register { 14700 + }; 14701 +class UString { 14702 +public: 14703 + unsigned length() const 14704 + { 14705 + return m_impl->length(); 14706 + } 14707 + const LChar* characters8() const 14708 + { 14709 + } 14710 + RefPtr<StringImpl> m_impl; 14711 +}; 14712 + class ExecState : private Register { 14713 + public: 14714 + JSValue argument(size_t argument) 14715 + { 14716 + } 14717 + }; 14718 + class JSCell { 14719 + }; 14720 + class JSString : public JSCell { 14721 + public: 14722 + const UString& value(ExecState*) const; 14723 + }; 14724 +class JSStringBuilder { 14725 +public: 14726 + void append(const UChar u) 14727 + { 14728 + m_okay &= buffer16.tryAppend(&u, 1); 14729 + } 14730 + Vector<UChar, 64> buffer16; 14731 + bool m_okay; 14732 +}; 14733 +template <typename T> 14734 +class Lexer { 14735 +public: 14736 + static unsigned char convertHex(int c1, int c2); 14737 +}; 14738 +} 14739 +namespace WTF { 14740 +namespace Unicode { 14741 + int UTF8SequenceLength(char); 14742 + int decodeUTF8Sequence(const char*); 14743 +} 14744 +} 14745 +using namespace WTF; 14746 +using namespace Unicode; 14747 +namespace JSC { 14748 +template <typename CharType> 14749 +static JSValue decode(ExecState* exec, const CharType* characters, int length, const char* doNotUnescape, bool strict) 14750 +{ 14751 + JSStringBuilder builder; 14752 + int k = 0; 14753 + UChar u = 0; 14754 + while (k < length) { 14755 + const CharType* p = characters + k; 14756 + CharType c = *p; 14757 + if (c == '%') { 14758 + int charLen = 0; 14759 + if (k <= length - 3 && isASCIIHexDigit(p[1]) && isASCIIHexDigit(p[2])) { 14760 + const char b0 = Lexer<CharType>::convertHex(p[1], p[2]); 14761 + const int sequenceLen = UTF8SequenceLength(b0); 14762 + if (sequenceLen && k <= length - sequenceLen * 3) { 14763 + charLen = sequenceLen * 3; 14764 + char sequence[5]; 14765 + if (charLen != 0) { 14766 + const int character = decodeUTF8Sequence(sequence); 14767 + if (character < 0 || character >= 0x110000) 14768 + charLen = 0; 14769 + else if (character >= 0x10000) { 14770 + builder.append(static_cast<UChar>(0xD800 | ((character - 0x10000) >> 10))); 14771 + } else 14772 + u = static_cast<UChar>(character); 14773 + } 14774 + } 14775 + } 14776 + } 14777 + } 14778 +} 14779 +static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict) 14780 +{ 14781 + UString str = exec->argument(0).toString(exec)->value(exec); 14782 + return decode(exec, str.characters8(), str.length(), doNotUnescape, strict); 14783 +} 14784 +EncodedJSValue globalFuncDecodeURI(ExecState* exec) 14785 +{ 14786 + static const char do_not_unescape_when_decoding_URI[] = 14787 + "#$&+,/:;=?@"; 14788 + return JSValue::encode(decode(exec, do_not_unescape_when_decoding_URI, true)); 14789 +} 14790 +} 12958 14791 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/opt/pr58006.C gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58006.C 12959 14792 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/opt/pr58006.C 1970-01-01 00:00:00.000000000 +0000 12960 +++ gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58006.C 2013- 09-13 19:01:43.199864872+000014793 +++ gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58006.C 2013-10-01 16:06:44.012554285 +0000 12961 14794 @@ -0,0 +1,22 @@ 12962 14795 +// PR tree-optimization/58006 … … 12984 14817 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/opt/pr58165.C gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58165.C 12985 14818 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/opt/pr58165.C 1970-01-01 00:00:00.000000000 +0000 12986 +++ gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58165.C 2013- 09-13 19:01:43.199864872+000014819 +++ gcc-4.8.1/gcc/testsuite/g++.dg/opt/pr58165.C 2013-10-01 16:06:44.012554285 +0000 12987 14820 @@ -0,0 +1,14 @@ 12988 14821 +// PR tree-optimization/58165 … … 13002 14835 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/parse/ref-qual2.C gcc-4.8.1/gcc/testsuite/g++.dg/parse/ref-qual2.C 13003 14836 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/parse/ref-qual2.C 1970-01-01 00:00:00.000000000 +0000 13004 +++ gcc-4.8.1/gcc/testsuite/g++.dg/parse/ref-qual2.C 2013- 09-13 19:01:43.199864872+000014837 +++ gcc-4.8.1/gcc/testsuite/g++.dg/parse/ref-qual2.C 2013-10-01 16:06:44.012554285 +0000 13005 14838 @@ -0,0 +1,6 @@ 13006 14839 +// PR c++/57532 … … 13010 14843 + return (int() & int()); 13011 14844 +} 14845 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/parse/using4.C gcc-4.8.1/gcc/testsuite/g++.dg/parse/using4.C 14846 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/parse/using4.C 1970-01-01 00:00:00.000000000 +0000 14847 +++ gcc-4.8.1/gcc/testsuite/g++.dg/parse/using4.C 2013-10-01 16:06:44.012554285 +0000 14848 @@ -0,0 +1,20 @@ 14849 +// PR c++/58457 14850 + 14851 +struct allocator 14852 +{ 14853 + void operator delete (void*); 14854 + void* operator new (__SIZE_TYPE__, void*); 14855 +}; 14856 + 14857 +struct type : public allocator 14858 +{ 14859 + type() {} 14860 + using allocator::operator new; 14861 + using allocator::operator delete; 14862 +}; 14863 + 14864 +int main() 14865 +{ 14866 + new (0) type; 14867 + return 0; 14868 +} 13012 14869 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/pr57878.C gcc-4.8.1/gcc/testsuite/g++.dg/pr57878.C 13013 14870 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/pr57878.C 1970-01-01 00:00:00.000000000 +0000 13014 +++ gcc-4.8.1/gcc/testsuite/g++.dg/pr57878.C 2013- 09-13 19:01:43.199864872+000014871 +++ gcc-4.8.1/gcc/testsuite/g++.dg/pr57878.C 2013-10-01 16:06:44.012554285 +0000 13015 14872 @@ -0,0 +1,226 @@ 13016 14873 +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ … … 13242 15099 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/abstract1.C gcc-4.8.1/gcc/testsuite/g++.dg/template/abstract1.C 13243 15100 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/abstract1.C 1970-01-01 00:00:00.000000000 +0000 13244 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/abstract1.C 2013- 09-13 19:01:43.199864872+000015101 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/abstract1.C 2013-10-01 16:06:44.012554285 +0000 13245 15102 @@ -0,0 +1,12 @@ 13246 15103 +// PR c++/58022 … … 13258 15115 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/access27.C gcc-4.8.1/gcc/testsuite/g++.dg/template/access27.C 13259 15116 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/access27.C 1970-01-01 00:00:00.000000000 +0000 13260 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/access27.C 2013- 09-13 19:01:43.199864872+000015117 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/access27.C 2013-10-01 16:06:44.012554285 +0000 13261 15118 @@ -0,0 +1,17 @@ 13262 15119 +// PR c++/57550 … … 13279 15136 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/arg9.C gcc-4.8.1/gcc/testsuite/g++.dg/template/arg9.C 13280 15137 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/arg9.C 1970-01-01 00:00:00.000000000 +0000 13281 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/arg9.C 2013- 09-13 19:01:43.199864872+000015138 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/arg9.C 2013-10-01 16:06:44.012554285 +0000 13282 15139 @@ -0,0 +1,8 @@ 13283 15140 +// PR c++/57771 … … 13291 15148 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/delete2.C gcc-4.8.1/gcc/testsuite/g++.dg/template/delete2.C 13292 15149 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/delete2.C 1970-01-01 00:00:00.000000000 +0000 13293 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/delete2.C 2013- 09-13 19:01:43.203198197+000015150 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/delete2.C 2013-10-01 16:06:44.012554285 +0000 13294 15151 @@ -0,0 +1,26 @@ 13295 15152 +// PR c++/58119 … … 13319 15176 + delete b; // { dg-error "template|delete" } 13320 15177 +} 15178 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/inherit9.C gcc-4.8.1/gcc/testsuite/g++.dg/template/inherit9.C 15179 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/inherit9.C 1970-01-01 00:00:00.000000000 +0000 15180 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/inherit9.C 2013-10-01 16:06:44.012554285 +0000 15181 @@ -0,0 +1,15 @@ 15182 +// PR c++/58273 15183 + 15184 +class A {}; 15185 +class B 15186 +{ 15187 + int goo(A); 15188 +}; 15189 +template<typename E> 15190 +class D : public B 15191 +{ 15192 + void foo(A t) 15193 + { 15194 + int const i(B::goo(t)); 15195 + } 15196 +}; 13321 15197 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/using23.C gcc-4.8.1/gcc/testsuite/g++.dg/template/using23.C 13322 15198 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/template/using23.C 1970-01-01 00:00:00.000000000 +0000 13323 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/using23.C 2013- 09-13 19:01:43.203198197+000015199 +++ gcc-4.8.1/gcc/testsuite/g++.dg/template/using23.C 2013-10-01 16:06:44.012554285 +0000 13324 15200 @@ -0,0 +1,15 @@ 13325 15201 +// PR c++/57831 … … 13338 15214 +}; 13339 15215 +template struct B< A >; 15216 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/uninit-pred-4.C gcc-4.8.1/gcc/testsuite/g++.dg/uninit-pred-4.C 15217 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/uninit-pred-4.C 1970-01-01 00:00:00.000000000 +0000 15218 +++ gcc-4.8.1/gcc/testsuite/g++.dg/uninit-pred-4.C 2013-10-01 16:06:44.012554285 +0000 15219 @@ -0,0 +1,16 @@ 15220 +/* { dg-do compile } */ 15221 +/* { dg-options "-Wuninitialized -Og" } */ 15222 + 15223 +int pop (); 15224 +int pop_first_bucket; 15225 + 15226 +int my_pop () 15227 +{ 15228 + int out; // { dg-bogus "uninitialized" "uninitialized variable warning" } 15229 + 15230 + while (pop_first_bucket) 15231 + if (pop_first_bucket && (out = pop())) 15232 + return out; 15233 + 15234 + return 0; 15235 +} 15236 diff -Naur gcc-4.8.1.orig/gcc/testsuite/g++.dg/warn/Wunused-var-21.C gcc-4.8.1/gcc/testsuite/g++.dg/warn/Wunused-var-21.C 15237 --- gcc-4.8.1.orig/gcc/testsuite/g++.dg/warn/Wunused-var-21.C 1970-01-01 00:00:00.000000000 +0000 15238 +++ gcc-4.8.1/gcc/testsuite/g++.dg/warn/Wunused-var-21.C 2013-10-01 16:06:44.012554285 +0000 15239 @@ -0,0 +1,31 @@ 15240 +// PR c++/58325 15241 +// { dg-do compile } 15242 +// { dg-options "-Wunused" } 15243 + 15244 +void 15245 +f1 () 15246 +{ 15247 + int *volatile a = new int[1]; 15248 + delete[] a; 15249 +} 15250 + 15251 +void 15252 +f2 () 15253 +{ 15254 + int *b = new int[1]; 15255 + delete[] b; 15256 +} 15257 + 15258 +void 15259 +f3 () 15260 +{ 15261 + int *volatile c = new int; 15262 + delete c; 15263 +} 15264 + 15265 +void 15266 +f4 () 15267 +{ 15268 + int *d = new int; 15269 + delete d; 15270 +} 15271 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/compile/pr58088.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/compile/pr58088.c 15272 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/compile/pr58088.c 1970-01-01 00:00:00.000000000 +0000 15273 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/compile/pr58088.c 2013-10-01 16:06:44.000554285 +0000 15274 @@ -0,0 +1,5 @@ 15275 +int 15276 +bar (int i) 15277 +{ 15278 + return 1 | ((i * 2) & 254); 15279 +} 13340 15280 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/compile/pr58164.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/compile/pr58164.c 13341 15281 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/compile/pr58164.c 1970-01-01 00:00:00.000000000 +0000 13342 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/compile/pr58164.c 2013- 09-13 19:01:43.186531574+000015282 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/compile/pr58164.c 2013-10-01 16:06:44.000554285 +0000 13343 15283 @@ -0,0 +1,8 @@ 13344 15284 +/* PR tree-optimization/58164 */ … … 13352 15292 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x 13353 15293 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x 1970-01-01 00:00:00.000000000 +0000 13354 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x 2013- 09-13 19:01:43.186531574+000015294 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x 2013-10-01 16:06:44.000554285 +0000 13355 15295 @@ -0,0 +1,5 @@ 13356 15296 +# Force bigger stack alignment for PowerPC EABI targets. … … 13361 15301 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr57568.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57568.c 13362 15302 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr57568.c 1970-01-01 00:00:00.000000000 +0000 13363 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57568.c 2013- 09-13 19:01:43.186531574+000015303 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57568.c 2013-10-01 16:06:44.000554285 +0000 13364 15304 @@ -0,0 +1,12 @@ 13365 15305 +/* PR target/57568 */ … … 13377 15317 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr57829.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57829.c 13378 15318 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr57829.c 1970-01-01 00:00:00.000000000 +0000 13379 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57829.c 2013- 09-13 19:01:43.186531574+000015319 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr57829.c 2013-10-01 16:06:44.000554285 +0000 13380 15320 @@ -0,0 +1,31 @@ 13381 15321 +/* PR rtl-optimization/57829 */ … … 13412 15352 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58209.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58209.c 13413 15353 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58209.c 1970-01-01 00:00:00.000000000 +0000 13414 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58209.c 2013- 09-13 19:01:43.186531574+000015354 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58209.c 2013-10-01 16:06:44.000554285 +0000 13415 15355 @@ -0,0 +1,32 @@ 13416 15356 +/* PR tree-optimization/58209 */ … … 13446 15386 + return 0; 13447 15387 +} 15388 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c 15389 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c 1970-01-01 00:00:00.000000000 +0000 15390 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58277-1.c 2013-10-01 16:06:44.000554285 +0000 15391 @@ -0,0 +1,102 @@ 15392 +/* PR tree-optimization/58277 */ 15393 + 15394 +extern void abort (void); 15395 +static int a[2]; 15396 +int b, c, d, *e, f, g, h, **i = &e, k, l = 1, n, o, p; 15397 +static int **volatile j = &e; 15398 +const int m; 15399 +char u; 15400 + 15401 +int 15402 +bar () 15403 +{ 15404 + u = 0; 15405 + return m; 15406 +} 15407 + 15408 +__attribute__((noinline, noclone)) void 15409 +baz () 15410 +{ 15411 + asm (""); 15412 +} 15413 + 15414 +static int 15415 +foo () 15416 +{ 15417 + int t1; 15418 + g = bar (); 15419 + if (l) 15420 + ; 15421 + else 15422 + for (;; h++) 15423 + { 15424 + *i = 0; 15425 + o = *e = 0; 15426 + if (p) 15427 + { 15428 + f = 0; 15429 + return 0; 15430 + } 15431 + for (;; k++) 15432 + { 15433 + int *t2 = 0; 15434 + int *const *t3[] = { 15435 + 0, 0, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, &t2, &t2, &t2, 15436 + &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 15437 + 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, &t2, 15438 + &t2, &t2, &t2, 0, 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 15439 + &t2, 0, 0, 0, &t2, 0, &t2, 0, 0, &t2, 0, 0, 0, 0, 15440 + 0, &t2, 0, 0, 0, 0, &t2, &t2, 0, 0, 0, 0, &t2, 0, 15441 + 0, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 0, 0, &t2, 0, 0, 0, 15442 + &t2, &t2 15443 + }; 15444 + int *const **t4[] = {&t3[0]}; 15445 + **i = 0; 15446 + if (**j) 15447 + break; 15448 + u = 0; 15449 + } 15450 + *i = *j; 15451 + t1 = 0; 15452 + for (; t1 < 5; t1++) 15453 + *i = *j; 15454 + } 15455 + *j = 0; 15456 + return 1; 15457 +} 15458 + 15459 +int 15460 +main () 15461 +{ 15462 + int t5; 15463 + a[0] = 1; 15464 + { 15465 + int *t6[6] = {&d, &d}; 15466 + for (n = 1; n; n--) 15467 + if (foo()) 15468 + { 15469 + int *t7[] = {0}; 15470 + d = 0; 15471 + for (; u < 1; u++) 15472 + *i = *j; 15473 + *i = 0; 15474 + *i = 0; 15475 + int t8[5] = {0}; 15476 + *i = &t8[0]; 15477 + int *const *t9 = &t6[0]; 15478 + int *const **t10 = &t9; 15479 + *t10 = &t7[0]; 15480 + } 15481 + } 15482 + u = 0; 15483 + for (; b; b++) 15484 + for (t5 = 0; t5 < 10; t5++) 15485 + c = a[a[a[a[a[a[a[a[c]]]]]]]]; 15486 + 15487 + baz (); 15488 + 15489 + if (!a[a[a[a[a[a[a[a[a[a[a[a[a[a[a[u]]]]]]]]]]]]]]]) 15490 + abort (); 15491 + 15492 + return 0; 15493 +} 15494 diff -Naur gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c 15495 --- gcc-4.8.1.orig/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c 1970-01-01 00:00:00.000000000 +0000 15496 +++ gcc-4.8.1/gcc/testsuite/gcc.c-torture/execute/pr58277-2.c 2013-10-01 16:06:44.000554285 +0000 15497 @@ -0,0 +1,98 @@ 15498 +/* PR tree-optimization/58277 */ 15499 + 15500 +extern void abort (void); 15501 +static int a[1], b, c, e, i, j, k, m, q[] = { 1, 1 }, t; 15502 +int volatile d; 15503 +int **r; 15504 +static int ***volatile s = &r; 15505 +int f, g, o, x; 15506 +static int *volatile h = &f, *p; 15507 +char n; 15508 + 15509 +static void 15510 +fn1 () 15511 +{ 15512 + b = a[a[a[a[a[a[a[a[b]]]]]]]]; 15513 + b = a[a[a[a[a[a[a[a[b]]]]]]]]; 15514 + b = a[a[b]]; 15515 + b = a[a[a[a[a[a[a[a[b]]]]]]]]; 15516 + b = a[a[a[a[a[a[a[a[b]]]]]]]]; 15517 +} 15518 + 15519 +static int 15520 +fn2 () 15521 +{ 15522 + n = 0; 15523 + for (; g; t++) 15524 + { 15525 + for (;; m++) 15526 + { 15527 + d; 15528 + int *u; 15529 + int **v[] = { 15530 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15531 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15532 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15533 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15534 +&n